<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Fri May 24, 2013 3:28 am by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Fri May 24, 2013 3:28 am</pubDate>
  <lastBuildDate>Fri May 24, 2013 3:28 am</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: C++ probs</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=14778#14778</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5299'&gt;otrus&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Mon Jan 02, 2006 1:48 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I had a similar problem. When I compiled using 'gcc -o hello hello.cpp' it returned a whole lot of errors. However, when I used 'g++ -o hello hello.cpp' it worked perfectly well. I tried using the '-x c++' option to specify c++ as the language, but that didn't work either. After a bit of research I found out that gcc didn't link to the c++ library, and even thogh I tried to explicitly specify the library I never got it to work. I probably didn't install the library properly.&lt;br /&gt;
&lt;br /&gt;
Anyway, that's not a big problem since I can just use 'g++' to make everything work.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=14778#14778</comments>
                                        <author>otrus</author>
                                        <pubDate>Mon Jan 02, 2006 1:48 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=14778#14778</guid>
                                      </item>
                                      <item>
                                        <title>Re: C++ probs</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=3854#3854</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=849'&gt;1slipperyfish&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Jun 23, 2005 7:18 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Quote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;hello.c:1:22: iostream.h: No such file or directory&lt;br /&gt;
hello.c: In function `main':&lt;br /&gt;
hello.c:6: error: `cout' undeclared (first use in this function)&lt;br /&gt;
hello.c:6: error: (Each undeclared identifier is reported only once&lt;br /&gt;
hello.c:6: error: for each function it appears in.) &lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
as far as i know the line 1:22 is because as i said it is an older version of c++ that was a crossover from c&lt;br /&gt;
the other errors are for the line&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;nbsp;cout &amp;lt;&amp;lt; &amp;quot;Hello World! &amp;quot;; &lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt; as you have not used &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;std&amp;#58;&amp;#58;cout &amp;lt;&amp;lt;&amp;quot;paul is great&amp;quot;;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt; that is all your errors mean (as they are all on line 6) another tip to avoid compiler errors is to press enter after your last bracket before you save it, otherwise you will get sometihng like &quot; no newline at file end&quot; or words to that effect&lt;br /&gt;
hope this helps&lt;br /&gt;
paul</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=3854#3854</comments>
                                        <author>1slipperyfish</author>
                                        <pubDate>Thu Jun 23, 2005 7:18 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=3854#3854</guid>
                                      </item>
                                      <item>
                                        <title>Re: C++ probs</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=3822#3822</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=1331'&gt;youlikeicecream&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Jun 23, 2005 11:30 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I managed to get Kdevelop to compile a simple KDE application after installing a whole heap of stuff but I cannot get a single peice of my code to run. &lt;br /&gt;
&lt;br /&gt;
Thanks for the info guys &lt;img src=&quot;images/smiles/icon_smile.gif&quot; alt=&quot;Smile&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Mike &lt;img src=&quot;images/smiles/icon_smile.gif&quot; alt=&quot;Smile&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=3822#3822</comments>
                                        <author>youlikeicecream</author>
                                        <pubDate>Thu Jun 23, 2005 11:30 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=3822#3822</guid>
                                      </item>
                                      <item>
                                        <title>Re: C++ probs</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=3787#3787</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=127'&gt;alloydog&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Jun 22, 2005 7:43 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Also, try losing the &lt;span style=&quot;font-weight: bold&quot;&gt;.h&lt;/span&gt; from the &lt;span style=&quot;font-weight: bold&quot;&gt;iostream&lt;/span&gt;&lt;br /&gt;
I found this with &lt;span style=&quot;font-weight: bold&quot;&gt;g++&lt;/span&gt;.  I got the message that the &lt;span style=&quot;font-weight: bold&quot;&gt;.h&lt;/span&gt; has been depreciated, but it still compiled, after I ignored the warning.  Rerunning the compiler with just &lt;span style=&quot;font-weight: bold&quot;&gt;#include &amp;lt;iostream.h&amp;gt;&lt;/span&gt; worked fine with out any messages.&lt;br /&gt;
&lt;br /&gt;
For C++, don't you need to save the inital file with the extention &lt;span style=&quot;font-weight: bold&quot;&gt;.cpp&lt;/span&gt;?&lt;br /&gt;
&lt;br /&gt;
It seems nearly every &quot;Hello World&quot; tutorial is different! As one of the more recent one's followed gave:&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
int main&amp;#40;&amp;#41;&lt;br /&gt;
&amp;#123;&lt;br /&gt;
cout &amp;lt;&amp;lt; &amp;quot;Hello World! /n&amp;quot;;&lt;br /&gt;
return 0;&lt;br /&gt;
&amp;#125;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Then it's compiled with:&lt;br /&gt;
&lt;span style=&quot;font-weight: bold&quot;&gt;g++ hello.cpp -o hello&lt;/span&gt;</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=3787#3787</comments>
                                        <author>alloydog</author>
                                        <pubDate>Wed Jun 22, 2005 7:43 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=3787#3787</guid>
                                      </item>
                                      <item>
                                        <title>Re: C++ probs</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=3783#3783</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=849'&gt;1slipperyfish&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Jun 22, 2005 7:37 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      i used &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
main&amp;#40;&amp;#41;&lt;br /&gt;
&amp;#123;&lt;br /&gt;
&lt;br /&gt;
std&amp;#58;&amp;#58;cout &amp;lt;&amp;lt; &amp;quot;Hello World! &amp;quot;;&lt;br /&gt;
&amp;#125; &lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
saved it as hello.cpp in /home/paul&lt;br /&gt;
then complied it as  g++ -o hello hello.cpp (as root) and ran it with ./hello&lt;br /&gt;
i am no expert but the compiler you said you used at work is probably an older one as not all compilers will accept the &quot;.h&quot; part &lt;br /&gt;
plus you had missed off the std:: part the only way around that would be to put using namespace std;  under #include....(but i wouldn't if you are new to c++) as this is older c++ as is .h&lt;br /&gt;
hope this helps&lt;br /&gt;
paul</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=3783#3783</comments>
                                        <author>1slipperyfish</author>
                                        <pubDate>Wed Jun 22, 2005 7:37 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=3783#3783</guid>
                                      </item>
                                      <item>
                                        <title>Re: C++ probs</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=3779#3779</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=53'&gt;wiz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Jun 22, 2005 6:58 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Try using&lt;br /&gt;
&lt;br /&gt;
g++ hello.c -o helloprog&lt;br /&gt;
&lt;br /&gt;
I think you need the the c++ compiler.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=3779#3779</comments>
                                        <author>wiz</author>
                                        <pubDate>Wed Jun 22, 2005 6:58 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=3779#3779</guid>
                                      </item>
                                      <item>
                                        <title>C++ probs</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=3772#3772</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=1331'&gt;youlikeicecream&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Jun 22, 2005 5:54 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi, bit new to C++ ... have written simple programs in C and compiled them on a remote UNIX shell using CC before but now when I try to compile programs on my Linuxbox at home It basically wont compile a damn thing. Here is the code I am using ....&lt;br /&gt;
&lt;br /&gt;
***********************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;iostream.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
   &lt;br /&gt;
        cout &amp;lt;&amp;lt; &quot;Hello World! &quot;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
**********************************************&lt;br /&gt;
&lt;br /&gt;
--- I type (as root) :&lt;br /&gt;
&lt;br /&gt;
# gcc hello.c -o helloprog&lt;br /&gt;
&lt;br /&gt;
--- and get these errors :&lt;br /&gt;
&lt;br /&gt;
hello.c:1:22: iostream.h: No such file or directory&lt;br /&gt;
hello.c: In function `main':&lt;br /&gt;
hello.c:6: error: `cout' undeclared (first use in this function)&lt;br /&gt;
hello.c:6: error: (Each undeclared identifier is reported only once&lt;br /&gt;
hello.c:6: error: for each function it appears in.)&lt;br /&gt;
&lt;br /&gt;
also I did a quick search for iostream.h and found it under /usr/include/c++/3.3/backward/iostream.h&lt;br /&gt;
&lt;br /&gt;
but I still got the same error message that it could not be found!!&lt;br /&gt;
&lt;br /&gt;
can anyone help? Am I doing something really stupid or is something improperly installed?&lt;br /&gt;
&lt;br /&gt;
thanks&lt;br /&gt;
Mike &lt;img src=&quot;images/smiles/icon_smile.gif&quot; alt=&quot;Smile&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=3772#3772</comments>
                                        <author>youlikeicecream</author>
                                        <pubDate>Wed Jun 22, 2005 5:54 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=3772#3772</guid>
                                      </item></channel></rss>