This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Undefined Reference
- From: Andrew Lunn <andrew at lunn dot ch>
- To: "paolo.destro-demo" <paolo dot destro-demo at poste dot it>
- Cc: ecos-discuss <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 28 Apr 2006 15:31:28 +0200
- Subject: Re: [ECOS] Undefined Reference
- References: <IYFP9E$AE4481984B0DEBE27DFAF065645B4795@poste.it>
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