vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I would really be very grateful for your help in the following issue: I need to compile code containing std::string objects in 64bit mode (g++ -maix64..) on AIX 5.2; I use G++ 4.1.1. When compiling, the linker complains about undefined symbols (see output below). All the libs (even stdc++) seemingly get found. Any workaround for this (compiling into a static library, removing shared libs from archive file, reverting to older g++ versions, using another binary copy of the stdc++ lib?) would be very much appreciated! (FYI: I downloaded the binary version of g++ from UCLA; the package did not contain libstdc++ for 64 bit, usually located in lib/ppc64. I extracted this library from IBM's latest libstdc++ rpm package and put it into the my local lib/ppc64 subdirectory. I have no root privilege on the system and no native IBM compiler, and won't get either.) Thanks a lot! --Martin Auer ------------ > /pfg/share/ccc/usr/local/bin/g++ -I/pfg/share/ccc/usr/local/include -v -maix64 f.c fmain.c Using built-in specs. Target: powerpc-ibm-aix5.2.0.0 Configured with: ../gcc-4.1.1/configure --disable-aix64 --disable-nls Thread model: aix gcc version 4.1.1 /pfg/share/ccc/usr/local/bin/../libexec/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/cc1plus -quiet -v -I/pfg/share/ccc/usr/local/include -iprefix /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/ -D_ALL_SOURCE -D__64BIT__ f.c -quiet -dumpbase f.c -maix64 -auxbase f -version -o /tmp//ccbKPiPY.s ignoring nonexistent directory "/pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/../../../../powerpc-ibm-aix5.2.0.0/include" ignoring nonexistent directory "/usr/local/lib/../include/c++/4.1.1" ignoring nonexistent directory "/usr/local/lib/../include/c++/4.1.1/powerpc-ibm-aix5.2.0.0" ignoring nonexistent directory "/usr/local/lib/../include/c++/4.1.1/backward" ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/include" ignoring nonexistent directory "/usr/local/lib/../powerpc-ibm-aix5.2.0.0/include" #include "..." search starts here: #include <...> search starts here: /pfg/share/ccc/usr/local/include /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/../../../../include/c++/4.1.1 /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/../../../../include/c++/4.1.1/powerpc-ibm-aix5.2.0.0 /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/../../../../include/c++/4.1.1/backward /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/include /usr/local/include /usr/include End of search list. GNU C++ version 4.1.1 (powerpc-ibm-aix5.2.0.0) compiled by GNU C version 4.1.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: b144591822a72fb210d0ab9dbaa95473 as -u -a64 -mppc64 -o /tmp//ccSb2bw4.o /tmp//ccbKPiPY.s /pfg/share/ccc/usr/local/bin/../libexec/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/cc1plus -quiet -v -I/pfg/share/ccc/usr/local/include -iprefix /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/ -D_ALL_SOURCE -D__64BIT__ fmain.c -quiet -dumpbase fmain.c -maix64 -auxbase fmain -version -o /tmp//ccbKPiPY.s ignoring nonexistent directory "/pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/../../../../powerpc-ibm-aix5.2.0.0/include" ignoring nonexistent directory "/usr/local/lib/../include/c++/4.1.1" ignoring nonexistent directory "/usr/local/lib/../include/c++/4.1.1/powerpc-ibm-aix5.2.0.0" ignoring nonexistent directory "/usr/local/lib/../include/c++/4.1.1/backward" ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/include" ignoring nonexistent directory "/usr/local/lib/../powerpc-ibm-aix5.2.0.0/include" #include "..." search starts here: #include <...> search starts here: /pfg/share/ccc/usr/local/include /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/../../../../include/c++/4.1.1 /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/../../../../include/c++/4.1.1/powerpc-ibm-aix5.2.0.0 /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/../../../../include/c++/4.1.1/backward /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/include /usr/local/include /usr/include End of search list. GNU C++ version 4.1.1 (powerpc-ibm-aix5.2.0.0) compiled by GNU C version 4.1.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: b144591822a72fb210d0ab9dbaa95473 as -u -a64 -mppc64 -o /tmp//ccpGC97e.o /tmp//ccbKPiPY.s /pfg/share/ccc/usr/local/bin/../libexec/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/collect2 -bpT:0x10000000 -bpD:0x20000000 -btextro -bnodelcsect -b64 /lib/crt0_64.o -L/pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/ppc64 -L/pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/../../../ppc64 -L/usr/local/lib /tmp//ccSb2bw4.o /tmp//ccpGC97e.o -lstdc++ -lm -lgcc_s /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/ppc64/libgcc.a -lc -lgcc_s /pfg/share/ccc/usr/local/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.1.1/ppc64/libgcc.a ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string() ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: ld returned 8 exit status |
| |||
| martin.auer@gmail.com writes: > When compiling, the linker complains about undefined symbols (see > output below). All the libs (even stdc++) seemingly get found. .... To diagnose these kinds of problems, look at the mangled names that are unresolved. In your particular case, do this: /pfg/share/ccc/usr/local/bin/g++ -I/pfg/share/ccc/usr/local/include -c -maix64 f.c fmain.c /usr/ccs/bin/nm -BC f.o fmain.o | grep ' U ' /usr/ccs/bin/nm -BC /path/to/lib/ppc64/libstdc++.a | grep ' T ' and compare the output. > (FYI: I downloaded the binary version of g++ from UCLA; the package > did not contain libstdc++ for 64 bit, usually located in lib/ppc64. I > extracted this library from IBM's latest libstdc++ rpm package and put > it into the my local lib/ppc64 subdirectory. What has likely happened is that you installed libstdc++.a that belongs to, and was compiled with, a different version of g++. C++ code compiled by different compilers, or by different versions of the same compiler, are generally *not* link-compatible. Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. |
| |||
| Paul Pluzhnikov <ppluzhnikov-nsp@charter.net> writes: > /usr/ccs/bin/nm -BC f.o fmain.o | grep ' U ' Make that: /usr/ccs/bin/nm -BC -X64 f.o fmain.o | grep ' U ' Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. |
| ||||
| On Tue, 20 Jun 2006 13:39:09 -0700, martin.auer wrote: > (FYI: I downloaded the binary version of g++ from UCLA; the package > did not contain libstdc++ for 64 bit, usually located in lib/ppc64. I > extracted this library from IBM's latest libstdc++ rpm package and put > it into the my local lib/ppc64 subdirectory. I have no root privilege > on the system and no native IBM compiler, and won't get either.) The libstdc++ from IBM's latest Linux Toolbox package appears to be broken, with a lot of missing exports. I installed the new gcc RPM's and had the same problem. Also see the thread from 2006-05-29: "Broken g++ 4.0.0 on AIX 5.1?" |