bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AIX 5.3 g++ 4.0.0 can't link "hello world"


From: Russell Ogilvie
Subject: AIX 5.3 g++ 4.0.0 can't link "hello world"
Date: Mon, 29 Jan 2007 20:11:41 -0700

The system successfully compiles plenty of c++ code written by c
programmers, but fails to link anything with #include <iostream> or
#include <string>.  I have spent several days pouring over anything
google could give me.  It is not in my nature to ask for help, but I
am now pleading for any suggestions.

The output when -Wl,-bnoquiet is used seems to indicate that the
linker knows right where to find what it needs in libstdc++, but for
some reason it leaves it out or something.

Here is a fairly good example:

bash-3.00$ uname -a
AIX thumgt2 3 5 0007F6FF4C00 powerpc unknown AIX
bash-3.00$ /usr/bin/ld -V
/usr/bin/ld: LD 1.64 (08/19/2003)
bash-3.00$ cat hello.C
#include <iostream>
int main(){
 std::cout << "Hello\n";
 return 0;
}
bash-3.00$ g++ -Wall -g -c hello.C
bash-3.00$ ls -l hello.o
-rw-r--r--  1 ltrgo1 generica 104312 2007-01-29 22:00 hello.o
bash-3.00$ echo $LIBPATH
/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0:/opt/freeware/lib:/usr/local/lib:/usr/lib:/lib:/usr/local/include:/usr/include
bash-3.00$ g++ -Wl,-bnoquiet -o howdy hello.o
(ld): halt 4
(ld): setopt r/o->w
(ld): setopt nodelcsect
(ld): setfflag 4
(ld): savename howdy
(ld): filelist 8 1
(ld): i /lib/crt0.o
(ld): i /tmp//ccyK1qvF.o
(ld): i hello.o
(ld): lib /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/libstdc++.a
(ld): lib /usr/lib/libm.a
(ld): lib /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/libgcc_s.a
(ld): i /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/libgcc.a
(ld): lib /usr/lib/libc.a
LIBRARY: Shared object libstdc++.a[libstdc++.so.6]: 1161 symbols imported.
LIBRARY: Shared object libgcc_s.a[shr.o]: 108 symbols imported.
LIBRARY: Shared object libc.a[shr.o]: 2723 symbols imported.
LIBRARY: Shared object libc.a[meth.o]: 2 symbols imported.
LIBRARY: Shared object libc.a[posix_aio.o]: 20 symbols imported.
LIBRARY: Shared object libc.a[aio.o]: 14 symbols imported.
LIBRARY: Shared object libc.a[pse.o]: 5 symbols imported.
LIBRARY: Shared object libc.a[dl.o]: 4 symbols imported.
LIBRARY: Shared object libc.a[pty.o]: 1 symbols imported.
FILELIST: Number of previously inserted files processed: 8
(ld): initfini _GLOBAL__FI_howdy _GLOBAL__FD_howdy
(ld): resolve
RESOLVE: 77 of 5512 symbols were kept.
(ld): addgl /usr/lib/glink.o
ADDGL: Glink code added for 12 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
       The following symbols are in error:
Symbol                    Inpndx  TY CL Source-File(Object-File) OR
Import-File{Shared-object}
                             RLD: Address  Section  Rld-type Referencing Symbol
----------------------------------------------------------------------------------------------
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*)
.std::basic_ostream<char, std::char_traits<char> >& std::operator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)[6]     ER PR hello.C(hello.o)
                                  0000001c .text    R_RBR    [521]   .main
ER: The return code is 8.
collect2: ld returned 8 exit status
bash-3.00$ g++ -v
Using built-in specs.
Target: powerpc-ibm-aix5.3.0.0
Configured with: ../configure --with-as=/usr/bin/as
--with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++
--prefix=/opt/freeware --enable-threads
--enable-version-specific-runtime-libs --host=powerpc-ibm-aix5.3.0.0
Thread model: aix
gcc version 4.0.0
bash-3.00$

If any other details would help, please let me know.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]