Hi all, I try to figure out how to compile the code below as 64bit executable: -- foo.cpp -- int main () { return 0; } -- The code compiles: $> g++ -m64 -O2 -g foo.cpp and: $> file a.out a.out: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped tells me that I got what I asked for, but: $> ldd a.out libstdc++.so.6 => /usr/local/lib/libstdc++.so.6 - wrong ELF class: ELFCLASS32 libm.so.1 => /usr/lib/64/libm.so.1 libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 - wrong ELF class: ELFCLASS32 libc.so.1 => /usr/lib/64/libc.so.1 libdl.so.1 => /usr/lib/64/libdl.so.1 /usr/platform/SUNW,Sun-Blade-1000/lib/sparcv9/libc_psr.so.1 As you can see, the linker (sun ld) seems to include the 32bit versions of libstd++ and libgcc_s, instead of their 64bit companions - which are located in '/usr/local/lib/sparcv9/'. Verbose output (see below) shows that -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 actually _is_ included in the library search path. What's wrong here? Do I miss something? Compiler flags? Linker flags? A bug in g++/collect2? Something completely different? Thanks in advance for any hints :) Daniel Franke $> g++ -v -m64 -O2 -g foo.cpp Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.1 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/cc1plus -quiet -v -D__arch64__ -D__sparcv9 foo.cpp -mptr64 -mstack-bias -mno-v8plus -quiet -dumpbase foo.cpp -m64 -mcpu=v7 -auxbase foo -g -O2 -version -o /var/tmp//ccKbcjqe.s ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../sparc-sun-solaris2.8/include" #include "..." search starts here: #include <...> search starts here: /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/sparc-sun-solaris2.8 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/backward /usr/local/include /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/include /usr/include End of search list. GNU C++ version 3.4.1 (sparc-sun-solaris2.8) compiled by GNU C version 3.4.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 /usr/ccs/bin/as -V -Qy -s -xarch=v9 -o /var/tmp//ccK2DZnn.o /var/tmp//ccKbcjqe.s /usr/ccs/bin/as: Sun WorkShop 6 99/08/18 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/collect2 -V -Y P,/usr/lib/sparcv9 -Qy /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crt1.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crti.o /usr/ccs/lib/sparcv9/values-Xa.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtbegin.o -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1 -L/usr/ccs/bin/sparcv9 -L/usr/ccs/bin -L/usr/ccs/lib/sparcv9 -L/usr/ccs/lib -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../.. -L/lib/sparcv9 -L/usr/lib/sparcv9 /var/tmp//ccK2DZnn.o -lstdc++ -lm -lgcc_s_sparcv9 -lgcc -lc -lgcc_s_sparcv9 -lgcc -lc /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtend.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtn.o ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.284 $> g++ -v reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.1 $> g++ -print-multi-lib .; sparcv9;@m64 -- Dipl.-Math. (FH) Daniel Franke Institut fuer Medizinische Biometrie und Statistik Medizinische Universität zu Luebeck Ratzeburger Allee 160, Haus 4 23538 Luebeck Telefon: 0451-500-2786 Telefax: 0451-500-2999 daniel.franke@xxxxxxxxxxxxxxxxxxx