[ECOS] Undefined Reference

paolo.destro-demo paolo.destro-demo@poste.it
Fri Apr 28 13:24:00 GMT 2006


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?

Thanks in advance
Paolo


--
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