<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visual C++ Tips &#187; Compiler Extension</title>
	<atom:link href="http://weseetips.com/category/compiler-extension/feed/" rel="self" type="application/rss+xml" />
	<link>http://weseetips.com</link>
	<description>Gold mine of Visual C++ tricks!</description>
	<lastBuildDate>Thu, 11 Mar 2010 09:09:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How to get the preprocessed C / C++ source files?</title>
		<link>http://weseetips.com/2008/06/12/how-to-get-the-preprocessed-c-cpp-source-files/</link>
		<comments>http://weseetips.com/2008/06/12/how-to-get-the-preprocessed-c-cpp-source-files/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 18:05:17 +0000</pubDate>
		<dc:creator>Jijo Raj</dc:creator>
				<category><![CDATA[Compiler Extension]]></category>
		<category><![CDATA[/P]]></category>
		<category><![CDATA[intermediate source files]]></category>
		<category><![CDATA[preprocessor]]></category>

		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=167</guid>
		<description><![CDATA[Everybody knows that before the real compilation, the source file will undergo the stage called preprocessing. All the compiler preprocessors such as #include, #define etc will be processed in this stage and that intermediate preprocessed file, which is the real source &#8211; will be fed to compiler for compiling. Its a bit difficult to troubleshoot [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-11" src="http://weseetips.files.wordpress.com/2008/03/icon_description.jpg?w=166" alt="" width="166" height="32" /><br />
Everybody knows that before the real compilation, the <span style="color:#0000ff;">source file will undergo the stage called preprocessing.</span> All the compiler preprocessors such as <span style="color:#0000ff;">#include</span>, <span style="color:#0000ff;">#define</span> etc will be processed in this stage and that <span style="color:#0000ff;">intermediate preprocessed file</span>, which is the real source &#8211; <span style="color:#0000ff;">will be fed to compiler for compiling</span>. Its a bit <span style="color:#0000ff;">difficult to troubleshoot problems with preprocessor( especially macro expansions )</span> because, the processed intermediate file is not available. But is to possible to get it?</p>
<p><img class="alignnone size-medium wp-image-12" src="http://weseetips.files.wordpress.com/2008/03/icon_howcanidoit.jpg?w=220" alt="" width="220" height="32" /><br />
Ofcourse. You can use the compiler option <strong><span style="color:#0000ff;">/P</span></strong>. Take the <span style="color:#0000ff;">project settings</span>, In the <span style="color:#0000ff;">C/C++ tab</span> add the <span style="color:#0000ff;">/P</span> to compiler options. See the screenshot below.</p>
<p><img class="alignnone size-full wp-image-168" src="http://siteground205.com/~weseetip/wp-content/uploads/2008/06/preprocessor_projectsettings.jpg" alt="" width="510" height="332" /></p>
<p>Now if you take your source folder, you can see files with extension <span style="color:#0000ff;"><strong>*.i<br />
</strong><span style="color:#000000;">So if you&#8217;ve some trouble in macro expansion, just generate the intermediate file and check.</span><strong> </strong></span></p>
<p><img class="alignnone size-medium wp-image-18" src="http://weseetips.files.wordpress.com/2008/03/icon_note.jpg?w=94" alt="" width="94" height="32" /><br />
<span style="color:#000000;">Open the generated intermediate file and see the contents. I&#8217;m sure you can&#8217;t believe your eyes. <img src='http://weseetips.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </span></p>
<p><img class="alignnone size-medium wp-image-51" src="http://weseetips.files.wordpress.com/2008/03/beginnerseries.jpg?w=215" alt="" width="215" height="32" /><br />
Targeted Audience &#8211; Beginners.</p>
]]></content:encoded>
			<wfw:commentRss>http://weseetips.com/2008/06/12/how-to-get-the-preprocessed-c-cpp-source-files/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Automatically link required libraries.</title>
		<link>http://weseetips.com/2008/04/11/automatically-link-required-libraries/</link>
		<comments>http://weseetips.com/2008/04/11/automatically-link-required-libraries/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 18:14:32 +0000</pubDate>
		<dc:creator>Jijo Raj</dc:creator>
				<category><![CDATA[Compiler Extension]]></category>
		<category><![CDATA[#pragma]]></category>
		<category><![CDATA[#pragma comment]]></category>
		<category><![CDATA[#pragma comment lib]]></category>
		<category><![CDATA[include library]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[VC++]]></category>
		<category><![CDATA[Visual C++]]></category>

		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=68</guid>
		<description><![CDATA[In our projects we use number of 3ed party API’s especially from platform SDK and other components and one burden is finding the libraries for those API’s. For Microsoft provided API’s since they have strong documentation, finding the library for particular API is not so tedious. But for other vendors, It may be. We need [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-11" src="http://weseetips.wordpress.com/files/2008/03/icon_description.jpg" alt="" width="166" height="32" /><br />
In our projects we use number of 3ed party API’s especially from platform SDK and other components and one burden is finding the libraries for those API’s. For Microsoft provided API’s since they have strong documentation, finding the library for particular API is not so tedious. But for other vendors, It may be. We need to dig a lot for finding the lib of that particular API. How can we get rid from this?</p>
<p><img class="alignnone size-full wp-image-12" src="http://weseetips.wordpress.com/files/2008/03/icon_howcanidoit.jpg" alt="" width="220" height="32" /><br />
You can you <span style="color:#0000ff;">#pragma comment( lib, &#8220;LibraryName&#8221; )</span> to specify the necessary library file in the header file itself. For e.g. See the following header file.</p>
<pre>// EventLog.h
class EventLog
{
    …
};
#ifdef _DEBUG
    // If it’s a debug version…
    #pragma comment( lib, "MyEventLogLibd.lib" )
#else
    // Ooooh!!! Its release version.
    #pragma comment( lib, "MyEventLogLib.lib" )
#endif</pre>
<p>If we include the EventLog.h header file, the library required will be automatically included. I dream for the day on which all SDK headers auto includes their libraries… <img src='http://weseetips.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><img class="alignnone size-medium wp-image-53" src="http://weseetips.wordpress.com/files/2008/03/intermediateseries.jpg" alt="" width="248" height="32" /><br />
Target audiance &#8211; Intermediate.</p>
]]></content:encoded>
			<wfw:commentRss>http://weseetips.com/2008/04/11/automatically-link-required-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integers with fixed size.</title>
		<link>http://weseetips.com/2008/04/01/integers-with-fixed-size/</link>
		<comments>http://weseetips.com/2008/04/01/integers-with-fixed-size/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 04:21:44 +0000</pubDate>
		<dc:creator>Jijo Raj</dc:creator>
				<category><![CDATA[Codeproject]]></category>
		<category><![CDATA[Compiler Extension]]></category>
		<category><![CDATA[int]]></category>
		<category><![CDATA[integer]]></category>
		<category><![CDATA[size of int]]></category>
		<category><![CDATA[VC++]]></category>
		<category><![CDATA[Visual C++]]></category>
		<category><![CDATA[__int16]]></category>
		<category><![CDATA[__int32]]></category>
		<category><![CDATA[__int64]]></category>
		<category><![CDATA[__int8]]></category>

		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=55</guid>
		<description><![CDATA[While manipulating integer, in some cases we are worried about the size of int. Because, it depends the word length of processor. For instance while generating a binary message for your hardware etc. Of course you have some macros such as BYTE etc which ensures the size in all processors word lengths, but will you [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://siteground205.com/~weseetip/wp-content/uploads/2008/03/icon_description.jpg" alt="Icon Description" /><br />
While manipulating integer, in some cases we are worried about the size of int. Because, it depends the word length of processor. For instance while generating a binary message for your hardware etc.</p>
<p>Of course you have some macros such as BYTE etc which ensures the size in all processors word lengths, but will you get the real feel of a built-in integer?</p>
<p><img src="http://siteground205.com/~weseetip/wp-content/uploads/2008/03/icon_howcanidoit.jpg" alt="Icon How Can I Do It?" /><br />
Microsoft had provided <strong><span style="color:#0000ff;">__int</span></strong><em><span style="color:#0000ff;">n</span></em> data types for integer values with different lengths. They are,</p>
<pre>// Directly from MSDN.
__int8 nSmall;      // Declares 8-bit integer
__int16 nMedium;    // Declares 16-bit integer
__int32 nLarge;     // Declares 32-bit integer
__int64 nHuge;      // Declares 64-bit integer</pre>
<p>You can use them without worrying about the length.</p>
<p><img src="http://siteground205.com/~weseetip/wp-content/uploads/2008/03/beginnerseries.jpg" alt="beginnerseries.jpg" /><br />
Targeted Audience &#8211; Beginners.</p>
]]></content:encoded>
			<wfw:commentRss>http://weseetips.com/2008/04/01/integers-with-fixed-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

