Problem with g++ compilation

Peter Rasmussen plr at udgaard.com
Wed Nov 5 22:53:31 CET 2008


In your example, add so it becomes the following:

#include<iostream>
using namespace std;
main()
{
int x;
cout<<"Testing G++"<<endl;
for(x=0;x<10;x++)
cout<<x<<endl;
}

I'm not an expert on C++, but this should do the job.

Peter

lakshmikanth wrote:

> HI
>
> A sample file test.C compilation attempt with g++ :
> *********************************************************************************
> root at om-gta02:~/kanth/c_prgs# cat test.C
>
> #include<iostream>
> main()
> {
> int x;
> cout<<"Testing G++"<<endl;
> for(x=0;x<10;x++)
> cout<<x<<endl;
> }
>
> root at om-gta02:~/kanth/c_prgs# g\+\+ -o test test.C
> test.C:1:19: error: iostream: No such file or directory
> test.C: In function 'int main()':
> test.C:5: error: 'cout' was not declared in this scope
> test.C:5: error: 'endl' was not declared in this scope
> root at om-gta02:~/kanth/c_prgs#
>
>
> *********************************************************************************
>
> It shows error with iostream : Where should i include the header files if at
> all. And where do i get Header files from(i read some where that normal
> header files cannot be added). Am i required to install an other packages?
>
> Thanks in advance....
>
> regards,
> Lakshmi Kanth
>
>
>
>
>
> Jay Vaughan wrote:
>   
>>> There are a few *-symlinks packages you'll want.  I believe it's
>>> gcc-symlinks.  Just do "opkg list | grep symlink" and install the
>>> relevant ones.
>>>       
>> .. and don't forget the -dev packages too ..
>>
>> ;
>> --
>> Jay Vaughan
>>
>>
>>
>>
>>
>> _______________________________________________
>> support mailing list
>> support at lists.openmoko.org
>> https://lists.openmoko.org/mailman/listinfo/support
>>
>>
>>     
>
>   



More information about the support mailing list