From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,52a86398916d1e6d,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-12-09 08:24:30 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!priapus.visi.com!orange.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news-han1.dfn.de!news.tu-bs.de!not-for-mail From: "I. Lange" Newsgroups: comp.unix.tru64 Subject: gcc 2.95.3, problem with ld on alphaev6-dec-osf5.1 Date: Tue, 09 Dec 2003 17:23:18 +0100 Organization: TU Braunschweig, Germany Distribution: world Message-ID: NNTP-Posting-Host: rzpclang.rz.tu-bs.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en Xref: archiver1.google.com comp.unix.tru64:11005 Dear GNU g++ folks, I need to use the old gcc 2.95.3 on "alphaev6-dec-osf5.1" to build some TAU components and have installed it into gcc-2.95.3.targ, apart from /usr/local/bin where gcc 3.0.4 is located. Could anyone tell me how to configure it with the system linker ld ? (gnu ld must not be used) I get serious errors when I try to build a simple c++ example program, which includes and : #include #include using namespace std; int main(int argc, char* argv[]) { string s(10, 'A'); // Create a string of ten A's. cout << s << endl; // Print it. return 0; } The error message is /bin/ld: Unresolved: cout ... when I call g++ with no options, and /bin/ld: Object file format error in: ../gcc-2.95.3.targ/lib: read_cur_obj_info: File is not a regular file collect2: ld returned 1 exit status when I specify -L /.../gcc-2.95.3.targ/lib. When I use gcc 3.0.4 (with PATH=...:/usr/local/bin:...), everything works fine Reading specs from /usr/local/lib/gcc-lib/alpha-dec-osf5.1/3.0.4/specs Configured with: ../gcc-3.0.4/configure Thread model: single gcc version 3.0.4 /usr/local/lib/gcc-lib/alpha-dec-osf5.1/3.0.4/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=4 -Dunix -D__osf__ -D_LONGLONG -DSYSTYPE_BSD -D_SYSTYPE_BSD -D__unix__ -D__osf__ -D_LONGLONG -D__SYSTYPE_BSD__ -D_SYSTYPE_BSD -D__unix -D__SYSTYPE_BSD -Asystem=unix -Asystem=xpg4 -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D__LANGUAGE_C__ -D__LANGUAGE_C -DLANGUAGE_C -Acpu=alpha -Amachine=alpha -D__alpha -D__alpha__ -D__alpha_ev4__ -Acpu=ev4 -D__X_FLOAT a.cpp -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase a.cpp -version -o /tmp/ccV4rS24.s GNU CPP version 3.0.4 (cpplib) GNU C++ version 3.0.4 (alpha-dec-osf5.1) compiled by GNU C version 3.0.4. ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/alpha-dec-osf5.1/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include/g++-v3 /usr/local/include/g++-v3/alpha-dec-osf5.1 /usr/local/include/g++-v3/backward /usr/local/include /usr/local/lib/gcc-lib/alpha-dec-osf5.1/3.0.4/include /usr/include End of search list. as -g -oldas -c -nocpp -O0 -o /tmp/ccgD8PNJ.o /tmp/ccV4rS24.s /usr/local/lib/gcc-lib/alpha-dec-osf5.1/3.0.4/mips-tfile -v -o /tmp/ccgD8PNJ.o /tmp/ccV4rS24.s mips-tfile version 3.0.4 /usr/local/lib/gcc-lib/alpha-dec-osf5.1/3.0.4/collect2 -G 8 -O1 -call_shared -o a3 /usr/lib/cmplrs/cc/crt0.o -L/usr/local/lib/gcc-lib/alpha-dec-osf5.1/3.0.4 -L/usr/lib/cmplrs/cc -L/usr/local/lib/gcc-lib/alpha-dec-osf5.1/3.0.4/../../.. /tmp/ccgD8PNJ.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc The complete output from 2.95.3 is > g++ -v a.cpp Reading specs from /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/specs gcc version 2.95.3 20010315 (release) /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/cpp0 -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Dunix -D__osf__ -D_LONGLONG -DSYSTYPE_BSD -D_SYSTYPE_BSD -D__unix__ -D__osf__ -D_LONGLONG -D__SYSTYPE_BSD__ -D_SYSTYPE_BSD -D__unix -D__SYSTYPE_BSD -Asystem(unix) -Asystem(xpg4) -D__EXCEPTIONS -D__LANGUAGE_C__ -D__LANGUAGE_C -DLANGUAGE_C -Acpu(alpha) -Amachine(alpha) -D__alpha -D__alpha__ -D__alpha_ev6__ -Acpu(ev6) -D__alpha_bwx__ -Acpu(bwx) -D__alpha_max__ -Acpu(max) -D__alpha_fix__ -Acpu(fix) a.cpp /tmp/ccILSBOS.ii GNU CPP version 2.95.3 20010315 (release) #include "..." search starts here: #include <...> search starts here: /home/ilange/app/local/tau/gcc-2.95.3.targ/usr/local/include/g++ /home/ilange/app/local/tau/gcc-2.95.3.targ/usr/local/include /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/../../../../alphaev6-dec-osf5.1/include /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/include /usr/include End of search list. The following default directories have been omitted from the search path: End of omitted list. /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/cc1plus /tmp/ccILSBOS.ii -quiet -dumpbase a.cc -version -o /tmp/cchBJi3M.s GNU C++ version 2.95.3 20010315 (release) (alphaev6-dec-osf5.1) compiled by GNU C version 2.95.3 20010315 (release). /home/ilange/app/local/tau/gcc-2.95.3.targ/as -g -nocpp -O0 -o /tmp/ccUcbX0d.o /tmp/cchBJi3M.s /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/mips-tfile -v -o /tmp/ccUcbX0d.o /tmp/cchBJi3M.s mips-tfile version 2.95.3 20010315 (release) /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/collect2 -G 8 -O1 -call_shared -o a2 /usr/lib/cmplrs/cc/crt0.o -L/home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3 -L/usr/lib/cmplrs/cc -L/home/ilange/app/local/tau/gcc-2.95.3.targ/lib /tmp/ccUcbX0d.o -lstdc++ -lm -lgcc -lc -lgcc /bin/ld: Unresolved: cout endl(ostream &) ostream::operator<<(ostream &(*)(ostream &)) __malloc_alloc_template<0>::__malloc_alloc_oom_handler cerr ostream::operator<<(char const *) __default_alloc_template::_S_end_free __default_alloc_template::_S_start_free __default_alloc_template::_S_heap_size __default_alloc_template::_S_free_list __out_of_range(char const *) __length_error(char const *) ostream::write(char const *, long) basic_string, __default_alloc_template >::nilRep string_char_traits::copy(char *, char const *, unsigned long) string_char_traits::set(char *, char const &, unsigned long) string_char_traits::move(char *, char const *, unsigned long) collect2: ld returned 1 exit status or > g++ -v -L /.../gcc-2.95.3.targ/lib Reading specs from /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/specs gcc version 2.95.3 20010315 (release) /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/cpp0 -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Dunix -D__osf__ -D_LONGLONG -DSYSTYPE_BSD -D_SYSTYPE_BSD -D__unix__ -D__osf__ -D_LONGLONG -D__SYSTYPE_BSD__ -D_SYSTYPE_BSD -D__unix -D__SYSTYPE_BSD -Asystem(unix) -Asystem(xpg4) -D__EXCEPTIONS -D__LANGUAGE_C__ -D__LANGUAGE_C -DLANGUAGE_C -Acpu(alpha) -Amachine(alpha) -D__alpha -D__alpha__ -D__alpha_ev6__ -Acpu(ev6) -D__alpha_bwx__ -Acpu(bwx) -D__alpha_max__ -Acpu(max) -D__alpha_fix__ -Acpu(fix) a.cpp /tmp/ccDBpOaZ.ii GNU CPP version 2.95.3 20010315 (release) #include "..." search starts here: #include <...> search starts here: /home/ilange/app/local/tau/gcc-2.95.3.targ/usr/local/include/g++ /home/ilange/app/local/tau/gcc-2.95.3.targ/usr/local/include /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/../../../../alphaev6-dec-osf5.1/include /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/include /usr/include End of search list. The following default directories have been omitted from the search path: End of omitted list. /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/cc1plus /tmp/ccDBpOaZ.ii -quiet -dumpbase a.cc -version -o /tmp/ccBpHIGc.s GNU C++ version 2.95.3 20010315 (release) (alphaev6-dec-osf5.1) compiled by GNU C version 2.95.3 20010315 (release). /home/ilange/app/local/tau/gcc-2.95.3.targ/as -g -nocpp -O0 -o /tmp/ccBXXJNc.o /tmp/ccBpHIGc.s /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/mips-tfile -v -o /tmp/ccBXXJNc.o /tmp/ccBpHIGc.s mips-tfile version 2.95.3 20010315 (release) /home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/collect2 -G 8 -O1 -call_shared -o a2_lib /usr/lib/cmplrs/cc/crt0.o -L ../gcc-2.95.3.targ/lib -L/home/ilange/app/local/tau/gcc-2.95.3.targ/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3 -L/usr/lib/cmplrs/cc -L/home/ilange/app/local/tau/gcc-2.95.3.targ/lib /tmp/ccBXXJNc.o -lstdc++ -lm -lgcc -lc -lgcc /bin/ld: Object file format error in: ../gcc-2.95.3.targ/lib: read_cur_obj_info: File is not a regular file collect2: ld returned 1 exit status Any ideas, especially why 3.0.4 links with -lgcc_s -lgcc -lc -lgcc_s -lgcc ... ? Ingolf Lange -- User Support * Computing Center of TU Braunschweig Hans-Sommer-Str. 65 * 38106 Braunschweig * Germany Phone (+(+49)531) 391-5560 * Secretariat -5510