2008/11/5 lakshmikanth <span dir="ltr">&lt;<a href="mailto:t.lakshmikanth@gmail.com">t.lakshmikanth@gmail.com</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
HI<br>
<br>
A sample file test.C compilation attempt with g++ :<br>
*********************************************************************************<br>
root@om-gta02:~/kanth/c_prgs# cat test.C<br>
<br>
#include&lt;iostream&gt;<br>
main()<br>
{<br>
int x;<br>
cout&lt;&lt;&quot;Testing G++&quot;&lt;&lt;endl;<br>
for(x=0;x&lt;10;x++)<br>
cout&lt;&lt;x&lt;&lt;endl;<br>
}<br>
<br>
root@om-gta02:~/kanth/c_prgs# g\+\+ -o test test.C<br>
test.C:1:19: error: iostream: No such file or directory<br>
test.C: In function &#39;int main()&#39;:<br>
test.C:5: error: &#39;cout&#39; was not declared in this scope<br>
test.C:5: error: &#39;endl&#39; was not declared in this scope<br>
root@om-gta02:~/kanth/c_prgs#<br>
<br>
<br>
*********************************************************************************<br>
<br>
It shows error with iostream : Where should i include the header files if at<br>
all. And where do i get Header files from(i read some where that normal<br>
header files cannot be added). Am i required to install an other packages?</blockquote><div><br>&nbsp;The c++ includes must have been installed together with the compiler
and the standard place is /usr/include/c++. Check where it is with
&quot;find / -name iostream&quot;. If it&#39;s in a strange place, add an option: g++
-Idirectory_where_iostream_is -o mytest test.C (test is also the name
of a builtin command).<br><br></div></div><br>