SEO

vBulletin Search Engine Optimization


Go Back   UnixAdminTalk.com > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2008, 05:13 PM
Huub
 
Posts: n/a
Default collect2: ld returned 8 exit status

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:perator<< <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
$

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.
Reply With Quote
  #2 (permalink)  
Old 01-18-2008, 05:13 PM
Christian Meier
 
Posts: n/a
Default Re: collect2: ld returned 8 exit status

"Huub" <"v.niekerk at hccnet.nl"> schrieb im Newsbeitrag
news:[email protected] ll.nl...
> 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:perator<< <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


Reply With Quote
  #3 (permalink)  
Old 01-19-2008, 06:57 AM
Huub
 
Posts: n/a
Default Re: 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.


I'm using the latest gcc version from the online Toolbox.

> 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.
>


I searched the net and found numerous hits, but none seemed to fit my case.

>
>> 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.


Which one?

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


Oh, ok. Had no idea...

Thanks.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:24 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0