This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: gcc 3.2.2 & STL library
- From: "Michael H. Cox" <mhcox at bluezoosoftware dot com>
- To: "Klein, Bernhard" <Bernhard dot Klein at logicacmg dot com>
- Cc: "GCC Help" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 24 Feb 2003 23:02:26 -0700
- Subject: RE: gcc 3.2.2 & STL library
- Reply-to: <mhcox at bluezoosoftware dot com>
> -----Original Message-----
> From: Klein, Bernhard [mailto:Bernhard dot Klein at logicacmg dot com]
> Sent: Monday, February 24, 2003 6:30 AM
> To: 'gcc-help at gcc dot gnu dot org'; 'gcc-help-faq at gcc dot gnu dot org'
> Subject: gcc 3.2.2 & STL library
>
>
>
> Hi All,
>
> I'm a newbie in gcc under Solaris 2.9 and try to work with the actual gcc
> release 3.2.2 and STL.
>
> I made a very simple c++ program including some STL functions (
> like string,
> iostream, etc).
> Compiling like this g++ -o cppstl cppstl.cpp
> works fine without compiler or linker errors, but after starting
> the program
> I got this error:
> ld.so.1: cppstl: fatal: relocation error: file cppstl: symbol _ZSt4cout:
> referenced symbol not found
> Killed
>
> mhm, It seems that my binary can'T find a library or something
> else ( but I
> don't know which library or what ever needed ).
Try adding -lstdc++ to your compile line and see what happens.
>
> After compiling with: g++ -static -o cppstl cppstl.cpp
> my little program works fine.
Not sure why this would fix your problem since the compiler still doesn't
know that it need to link to stdc++, either statically or dynamically. So
the above suggestion may not help.
>
> I hope that somebody can help me.
>
> Bernd Klein
> ----------------------------------------------------------
> Logica GmbH
> Financial Services, GB 21
> Faulenstraße 31-35
> 28195 Bremen
> Phone : +49 421 30 96-121
> Fax : +49 421 30 96-118
> Email : kleinbe at logica dot com
> ----------------------------------------------------------
>
> This e-mail and any attachment is for authorised use by the
> intended recipient(s) only. It may contain proprietary material,
> confidential information and/or be subject to legal privilege.
> It should not be copied, disclosed to, retained or used by, any
> other party. If you are not an intended recipient then please
> promptly delete this e-mail and any attachment and all copies and
> inform the sender. Thank you.
>