Re: collect2: ld returned 8 exit status



"Huub" <"v.niekerk at hccnet.nl"> schrieb im Newsbeitrag
news:47909572$0$26965$e4fe514c@xxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

Running AIX 5.3, I'm trying to compile a short piece of code in C++:

#include <iostream>

using namespace std;

int main()
{
cout << "Dit is AIX 5.3 - C++\n";
}

Compilation:

$ g++ test.cpp -o testcpp
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostream<char,
std::char_traits<char> >& std::operator<< <std::char_traits<char>
(std::basic_ostream<char, std::char_traits<char> >&, char const*)
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
collect2: ld returned 8 exit status
$


Hi

I had the same problem a few days ago. After some research I decided to
upgrade the gcc version.
IIRC there is a workarround for the problem. But it is has one or more
disadvantages. You can find the solution, if you google for it.



Trying with the suggested options:
$ g++ -bnoqiuet test.cpp -o testcpp
g++: couldn't run 'noqiuet-gcc-4.0.0': No such file or directory
$ g++ -bloadmap test.cpp -o testcpp
g++: couldn't run 'loadmap-gcc-4.0.0': No such file or directory
$ g++ test.cpp -bnoquiet -o testcpp
g++: '-b' must come at the start of the command line

Any clues on how to get on?
Thanks.

1. There is a typo.
2. -bnoquiet and -bloadmap are linker options. You have to use it like
"g++ -Wl,-bnoquiet test.cpp -o testcpp".

Regards, Chris


.



Relevant Pages

  • Nested Union Structure and scope resolution operator
    ... using namespace std; //introduces namespace std ... I tried to compile the source using both C++ Builder and Metrowerks ...
    (alt.comp.lang.learn.c-cpp)
  • Re: STL on Solaris system
    ... I would like compile a little program in c++ ... using namespace std; ... test.cpp: In function 'int main': ... This is free software; see the source for copying conditions. ...
    (comp.unix.solaris)
  • Re: Unable to match function definition to an existing declaration
    ... > using namespace std; ... > int main ... and it can't compile it either. ... to submit a bug report for that, ...
    (microsoft.public.vc.language)
  • Re: C++ compile error
    ... > hello.C: In function `int main': ... +using namespace std; ... > complex language when I compile my first program. ... > This post may off topic of FreeBSD, ...
    (freebsd-questions)
  • collect2: ld returned 8 exit status
    ... using namespace std; ... int main ... $ g++ test.cpp -o testcpp ... Trying with the suggested options: ...
    (comp.unix.aix)