[ECOS] Undefined Reference

Andrew Lunn andrew@lunn.ch
Fri Apr 28 13:31:00 GMT 2006


On Fri, Apr 28, 2006 at 03:24:50PM +0200, paolo.destro-demo wrote:
> Hi, I'm trying to compile this program
> 
> //file name: librerie.cc
> #include <iostream>
> using namespace std;
> int main(){
> 	cout << "Hello World" << endl;
> };
> 
> using g++ version 296, but it doesn't work!
> The compiler give me this error message
> 
> /usr/include/g++-3/iostream.h:106: undefined reference to `cout'
> librerie.o(.text.main+0x11):/usr/include/g++-3/iostream.h:106:
> undefined reference to `ostream::operator<<(char const *)'
> librerie.o(.text.main+0x19):/usr/include/g++-3/iostream.h:106:
> undefined reference to `endl(ostream &)'
> collect2: ld returned 1 exit status
> 
> If I use "stdio.h" and "printf" instead of "iostream" and
> "cout", the program work.
> 
> How can I use the class iostream in my programs for eCos?

anoncvs version of eCos does not support iostreams etc.

If you want a full C++ environment you need to talk to eCosCentric
about purchasing there version of eCos, or look back in the archives
where people have managed some quick and dirty ports of the standard
C++ libraries.

    Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list