public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Undefined Reference
@ 2006-04-28 13:24 paolo.destro-demo
  2006-04-28 13:31 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: paolo.destro-demo @ 2006-04-28 13:24 UTC (permalink / raw)
  To: ecos-discuss

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Undefined Reference
  2006-04-28 13:24 [ECOS] Undefined Reference paolo.destro-demo
@ 2006-04-28 13:31 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2006-04-28 13:31 UTC (permalink / raw)
  To: paolo.destro-demo; +Cc: ecos-discuss

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-28 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-28 13:24 [ECOS] Undefined Reference paolo.destro-demo
2006-04-28 13:31 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).