is it just me?! (linker troubles)
llewelly@dbritsch.dsl.xmission.com
llewelly@dbritsch.dsl.xmission.com
Tue Apr 25 08:40:00 GMT 2000
On Tue, 25 Apr 2000, Gerhard Wesp wrote:
> hello,
>
> after the easter break, i continued to try to install libstdc++-2.90.8
> (with gcc-2.95.2). after the deletion of the -Werror flag, it compiles
> fine, however, the resulting compiler chokes on a simple hello.cc:
>
> grisu% which gcc
> /usr/local/bin/gcc
> # yes, this _is_ the new compiler
>
> grisu% gcc hello.cc
> /tmp/ccmwuqlA.o: In function `main':
> /tmp/ccmwuqlA.o(.text+0xf): undefined reference to `cout'
> /tmp/ccmwuqlA.o(.text+0x14): undefined reference to `basic_ostream<char, char_traits<char> > & operator<<<char_traits<char> >(basic_ostream<char, char_traits<char> > &, char const *)'
> /tmp/ccmwuqlA.o: In function `__static_initialization_and_destruction_0':
> /tmp/ccmwuqlA.o(.text+0x46): undefined reference to `ios_base::Init::Init(void)'
> /tmp/ccmwuqlA.o(.text+0x5b): undefined reference to `ios_base::Init::~Init(void)'
> /tmp/ccmwuqlA.o: In function `ios_base::failure type_info function':
> /tmp/ccmwuqlA.o(.gnu.linkonce.t.__tfQ28ios_base7failure+0x10): undefined reference to `exception type_info function'
> /tmp/ccmwuqlA.o(.gnu.linkonce.t.__tfQ28ios_base7failure+0x1a): undefined reference to `exception type_info node'
> collect2: ld returned 1 exit status
>
> grisu% cat hello.cc
> #include <iostream>
>
> using namespace std;
>
> int main()
> {
> cout << "hello world\n";
> return 0;
> }
>
> what's happening here? fyi, this is on a debian 2.2 linux system.
libstdc++ 2.90.8 builds itself, and rebuilds libgcc, with -fhonor-std.
Therefore, whenever you are going to link something with libstdc++ 2.90.8,
you need to add -fhonor-std to your compiler flags.
I think this is your problem.
If you want to know more about -fhonor-std, see
http://gcc.gnu.org/fom_serv/cache/68.html . If you find that explanation
unclear or incorrect, tell me and I will fix it.
More information about the Libstdc++
mailing list