<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: 1.8 &#8212; Programs with multiple files</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 12:30:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: jonathan.mclaren</title>
		<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/comment-page-2/#comment-96868</link>
		<dc:creator>jonathan.mclaren</dc:creator>
		<pubDate>Sat, 21 Jan 2012 20:30:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=31#comment-96868</guid>
		<description>I am dealing with the same error.  

It resolves when I add the add() below the main(), though the point of this is to rely on add() in a separate file.  I would greatly appreciate help with this.</description>
		<content:encoded><![CDATA[<p>I am dealing with the same error.  </p>
<p>It resolves when I add the add() below the main(), though the point of this is to rely on add() in a separate file.  I would greatly appreciate help with this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ionman101</title>
		<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/comment-page-2/#comment-96669</link>
		<dc:creator>ionman101</dc:creator>
		<pubDate>Sat, 17 Dec 2011 16:04:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=31#comment-96669</guid>
		<description>I found out why it isnt running on codeblocks (atleast on my computer). When you open a new file for the project, it creates the file with just *.c instead of *.cpp. Try saving the new &quot;add&quot; file with .cpp at the end. I did that and it ran with no errors</description>
		<content:encoded><![CDATA[<p>I found out why it isnt running on codeblocks (atleast on my computer). When you open a new file for the project, it creates the file with just *.c instead of *.cpp. Try saving the new &#8220;add&#8221; file with .cpp at the end. I did that and it ran with no errors</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: myths</title>
		<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/comment-page-2/#comment-96296</link>
		<dc:creator>myths</dc:creator>
		<pubDate>Sat, 05 Nov 2011 04:39:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=31#comment-96296</guid>
		<description>the example for the add.cpp does not show the
#include &quot;stdafx.h&quot;//it is an individual .cpp


#include //it has a return function
 
it needs to be included...</description>
		<content:encoded><![CDATA[<p>the example for the add.cpp does not show the<br />
#include &#8220;stdafx.h&#8221;//it is an individual .cpp</p>
<p>#include //it has a return function</p>
<p>it needs to be included&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: socal93</title>
		<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/comment-page-2/#comment-96267</link>
		<dc:creator>socal93</dc:creator>
		<pubDate>Wed, 02 Nov 2011 04:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=31#comment-96267</guid>
		<description>I couldnt get this to run..... When i compile the the two files i get a error saying &quot; Undefined reference to add(int,int) &quot; 

I have the code set up all the same as yours. Im assuming that the compiler doesnt see add.cpp. 

Im using code::blocks.</description>
		<content:encoded><![CDATA[<p>I couldnt get this to run&#8230;.. When i compile the the two files i get a error saying &#8221; Undefined reference to add(int,int) &#8221; </p>
<p>I have the code set up all the same as yours. Im assuming that the compiler doesnt see add.cpp. </p>
<p>Im using code::blocks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/comment-page-2/#comment-96110</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Sat, 08 Oct 2011 12:15:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=31#comment-96110</guid>
		<description>something&#039;s up with your compiler. Re-install &amp; reconfigure.</description>
		<content:encoded><![CDATA[<p>something&#8217;s up with your compiler. Re-install &amp; reconfigure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marki123</title>
		<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/comment-page-2/#comment-96072</link>
		<dc:creator>marki123</dc:creator>
		<pubDate>Sun, 25 Sep 2011 11:27:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=31#comment-96072</guid>
		<description>i have put in the code for both files in to code blocks exactly. \(main and add)
but when it comes to compiling it it seems fine with the code but give the warning message.
&quot;WARNING: Can&#039;t read file&#039;s timestamp: C:\Documents and Settings\Desktop\multi-file programs\Untitled1.c
Linking console executable: bin\Debug\multi-file programs.exe
mingw32-g++.exe: obj\Debug\Untitled1.o: No such file or directory</description>
		<content:encoded><![CDATA[<p>i have put in the code for both files in to code blocks exactly. \(main and add)<br />
but when it comes to compiling it it seems fine with the code but give the warning message.<br />
&#8220;WARNING: Can&#8217;t read file&#8217;s timestamp: C:\Documents and Settings\Desktop\multi-file programs\Untitled1.c<br />
Linking console executable: bin\Debug\multi-file programs.exe<br />
mingw32-g++.exe: obj\Debug\Untitled1.o: No such file or directory</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pshetty</title>
		<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/comment-page-2/#comment-96030</link>
		<dc:creator>pshetty</dc:creator>
		<pubDate>Fri, 16 Sep 2011 22:51:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=31#comment-96030</guid>
		<description>for those of you who faced linker errors, the reason could be that you did not add the iostream header file in your cpp file where you have defined the function</description>
		<content:encoded><![CDATA[<p>for those of you who faced linker errors, the reason could be that you did not add the iostream header file in your cpp file where you have defined the function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Babysabre</title>
		<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/comment-page-2/#comment-95831</link>
		<dc:creator>Babysabre</dc:creator>
		<pubDate>Sun, 07 Aug 2011 04:35:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=31#comment-95831</guid>
		<description>I&#039;m using Code::Blocks and it&#039;s complaining about multiple definitions:

&lt;pre&gt;
File              Line  Message
obj\debug\extra.o       In function &#039;Z3addii&#039;
F:\C++\test\ad... 2     multiple definitions of &#039;add(int, int)&#039;
Obj\Debug\add.... 2     first defined here
                        === Build finished: 2 errors, 0 warnings ===
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;m using Code::Blocks and it&#8217;s complaining about multiple definitions:</p>
<pre>
File              Line  Message
obj\debug\extra.o       In function &#039;Z3addii&#039;
F:\C++\test\ad... 2     multiple definitions of &#039;add(int, int)&#039;
Obj\Debug\add.... 2     first defined here
                        === Build finished: 2 errors, 0 warnings ===
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aditya</title>
		<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/comment-page-2/#comment-95329</link>
		<dc:creator>Aditya</dc:creator>
		<pubDate>Thu, 14 Apr 2011 09:20:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=31#comment-95329</guid>
		<description>I use a turbo c++ 3.0 compiler. It has worked perfectly in every code so far.
I have tried the above code word for word but it didn&#039;t work. it doesn&#039;t link it.
do I have to follow some extra steps??</description>
		<content:encoded><![CDATA[<p>I use a turbo c++ 3.0 compiler. It has worked perfectly in every code so far.<br />
I have tried the above code word for word but it didn&#8217;t work. it doesn&#8217;t link it.<br />
do I have to follow some extra steps??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bitpoint</title>
		<link>http://www.learncpp.com/cpp-tutorial/18-programs-with-multiple-files/comment-page-2/#comment-95309</link>
		<dc:creator>bitpoint</dc:creator>
		<pubDate>Sun, 03 Apr 2011 23:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=31#comment-95309</guid>
		<description>It should probably be mentioned here that #include &quot;stdafx.h&quot; should be placed at the top of each file as the program did not compile without it.  I had assumed incorrectly that the compiler would simply include whatever was on the main function file for each file.  I&#039;m assuming if you want to include anything else it must be placed at the top of each file.</description>
		<content:encoded><![CDATA[<p>It should probably be mentioned here that #include &#8220;stdafx.h&#8221; should be placed at the top of each file as the program did not compile without it.  I had assumed incorrectly that the compiler would simply include whatever was on the main function file for each file.  I&#8217;m assuming if you want to include anything else it must be placed at the top of each file.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

