errors in linking with g77 compiled code
Hi.
I tried to compile some test code that links pieces of a
library compiled with g77. I get the errors reported in the
attachment.
On the other hand, if I remove the part that needs
linking with this library and I replace it so that it calls
the standard 'rand' function, then it compiles and links
successfully.
The library I'm referring to is the CERN library containing the
function 'ranlux'.
Thanks,
Ettore
--
Ettore Aldrovandi -- SISSA/International School for Advanced Studies
Via Beirut 2/4, I-34013 Trieste, Italy
ph: [+] 39 0403787445 -- fax:[+] 39 0403787528
ettore@fm.sissa.it aldrovan@sissa.it http://www.sissa.it/~aldrovan
albemuth:~/tth> fort -v -otth tthnoqcd.f sage2.f -L/usr/local/cern/98/lib \
? -lmathlib
/usr/lib/compaq/cfal/decfort90 -o /tmp/for18961aaa.o tthnoqcd.f sage2.f
/usr/bin/cc -v -otth -L/usr/local/cern/98/lib /tmp/for18961aaa.o -O3 -lmathlib /usr/lib/compaq/cfal/for_main.o -lUfor -lfor -lFutil -lcpml -lots
Reading specs from /usr/lib/gcc-lib/alpha-linux/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
/usr/lib/gcc-lib/alpha-linux/egcs-2.90.29/ld -m elf64alpha -G 8 -O3 -dynamic-linker /lib/ld-linux.so.2 -otth /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/local/cern/98/lib -L/usr/lib/gcc-lib/alpha-linux/egcs-2.90.29 /tmp/for18961aaa.o -lmathlib /usr/lib/compaq/cfal/for_main.o -lUfor -lfor -lFutil -lcpml -lots -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
/usr/local/cern/98/lib/libmathlib.a(ranlux.o): In function `__g77_masterfun_ranlux':
ranlux.F(.text+0xa0): undefined reference to `s_wsfe'
ranlux.F(.text+0xa4): undefined reference to `s_wsfe'
ranlux.F(.text+0xbc): undefined reference to `do_fio'
ranlux.F(.text+0xc0): undefined reference to `do_fio'
ranlux.F(.text+0xd8): undefined reference to `do_fio'
ranlux.F(.text+0xdc): undefined reference to `do_fio'
ranlux.F(.text+0xe8): undefined reference to `e_wsfe'
ranlux.F(.text+0xec): undefined reference to `e_wsfe'
ranlux.F(.text+0x13c): undefined reference to `s_wsfe'
ranlux.F(.text+0x140): undefined reference to `s_wsfe'
ranlux.F(.text+0x158): undefined reference to `do_fio'
ranlux.F(.text+0x15c): undefined reference to `do_fio'
ranlux.F(.text+0x174): undefined reference to `do_fio'
ranlux.F(.text+0x178): undefined reference to `do_fio'
ranlux.F(.text+0x190): undefined reference to `do_fio'
/usr/local/cern/98/lib/libmathlib.a(ranlux.o)(.text+0x194):ranlux.F: more undefined references to `do_fio' follow
/usr/local/cern/98/lib/libmathlib.a(ranlux.o): In function `__g77_masterfun_ranlux':
ranlux.F(.text+0x1bc): undefined reference to `e_wsfe'
ranlux.F(.text+0x1c0): undefined reference to `e_wsfe'
ranlux.F(.text+0x6bc): undefined reference to `s_wsfe'
ranlux.F(.text+0x6c0): undefined reference to `s_wsfe'
ranlux.F(.text+0x6d8): undefined reference to `do_fio'
ranlux.F(.text+0x6dc): undefined reference to `do_fio'
ranlux.F(.text+0x6e8): undefined reference to `e_wsfe'
ranlux.F(.text+0x6ec): undefined reference to `e_wsfe'
ranlux.F(.text+0x6fc): undefined reference to `s_wsfe'
ranlux.F(.text+0x700): undefined reference to `s_wsfe'
ranlux.F(.text+0x718): undefined reference to `do_fio'
ranlux.F(.text+0x71c): undefined reference to `do_fio'
ranlux.F(.text+0x728): undefined reference to `e_wsfe'
ranlux.F(.text+0x72c): undefined reference to `e_wsfe'
ranlux.F(.text+0x8f4): undefined reference to `s_wsfe'
ranlux.F(.text+0x8f8): undefined reference to `s_wsfe'
ranlux.F(.text+0x938): undefined reference to `s_wsfe'
ranlux.F(.text+0x93c): undefined reference to `s_wsfe'
ranlux.F(.text+0x954): undefined reference to `do_fio'
ranlux.F(.text+0x958): undefined reference to `do_fio'
ranlux.F(.text+0x970): undefined reference to `do_fio'
ranlux.F(.text+0x974): undefined reference to `do_fio'
ranlux.F(.text+0x980): undefined reference to `e_wsfe'
ranlux.F(.text+0x984): undefined reference to `e_wsfe'
ranlux.F(.text+0x9a8): undefined reference to `s_wsfe'
ranlux.F(.text+0x9ac): undefined reference to `s_wsfe'
ranlux.F(.text+0x9c4): undefined reference to `do_fio'
ranlux.F(.text+0x9c8): undefined reference to `do_fio'
ranlux.F(.text+0x9e0): undefined reference to `do_fio'
ranlux.F(.text+0x9e4): undefined reference to `do_fio'
ranlux.F(.text+0x9f0): undefined reference to `e_wsfe'
ranlux.F(.text+0x9f4): undefined reference to `e_wsfe'
ranlux.F(.text+0xb98): undefined reference to `s_wsfe'
ranlux.F(.text+0xb9c): undefined reference to `s_wsfe'
ranlux.F(.text+0xbb4): undefined reference to `do_fio'
ranlux.F(.text+0xbb8): undefined reference to `do_fio'
ranlux.F(.text+0xbd0): undefined reference to `do_fio'
ranlux.F(.text+0xbd4): undefined reference to `do_fio'
ranlux.F(.text+0xbe0): undefined reference to `e_wsfe'
ranlux.F(.text+0xbe4): undefined reference to `e_wsfe'
ranlux.F(.text+0xc7c): undefined reference to `s_wsfe'
ranlux.F(.text+0xc80): undefined reference to `s_wsfe'
ranlux.F(.text+0xc98): undefined reference to `do_fio'
ranlux.F(.text+0xc9c): undefined reference to `do_fio'
ranlux.F(.text+0xcb4): undefined reference to `do_fio'
ranlux.F(.text+0xcb8): undefined reference to `do_fio'
ranlux.F(.text+0xcd0): undefined reference to `do_fio'
/usr/local/cern/98/lib/libmathlib.a(ranlux.o)(.text+0xcd4):ranlux.F: more undefined references to `do_fio' follow
/usr/local/cern/98/lib/libmathlib.a(ranlux.o): In function `__g77_masterfun_ranlux':
ranlux.F(.text+0xd10): undefined reference to `s_wsfe'
ranlux.F(.text+0xd14): undefined reference to `s_wsfe'
ranlux.F(.text+0xd2c): undefined reference to `do_fio'
ranlux.F(.text+0xd30): undefined reference to `do_fio'
ranlux.F(.text+0xd48): undefined reference to `do_fio'
ranlux.F(.text+0xd4c): undefined reference to `do_fio'
ranlux.F(.text+0xd58): undefined reference to `e_wsfe'
ranlux.F(.text+0xd5c): undefined reference to `e_wsfe'
ranlux.F(.text+0xd7c): undefined reference to `s_wsfe'
ranlux.F(.text+0xd80): undefined reference to `s_wsfe'
ranlux.F(.text+0xd98): undefined reference to `do_fio'
ranlux.F(.text+0xd9c): undefined reference to `do_fio'
ranlux.F(.text+0xda8): undefined reference to `e_wsfe'
ranlux.F(.text+0xdac): undefined reference to `e_wsfe'
ranlux.F(.text+0xdd0): undefined reference to `s_wsfe'
ranlux.F(.text+0xdd4): undefined reference to `s_wsfe'
ranlux.F(.text+0xdec): undefined reference to `do_fio'
ranlux.F(.text+0xdf0): undefined reference to `do_fio'
ranlux.F(.text+0xe08): undefined reference to `do_fio'
ranlux.F(.text+0xe0c): undefined reference to `do_fio'
ranlux.F(.text+0xe24): undefined reference to `do_fio'
/usr/local/cern/98/lib/libmathlib.a(ranlux.o)(.text+0xe28):ranlux.F: more undefined references to `do_fio' follow
/usr/local/cern/98/lib/libmathlib.a(ranlux.o): In function `__g77_masterfun_ranlux':
ranlux.F(.text+0xe58): undefined reference to `s_wsfe'
ranlux.F(.text+0xe5c): undefined reference to `s_wsfe'
ranlux.F(.text+0xe74): undefined reference to `do_fio'
ranlux.F(.text+0xe78): undefined reference to `do_fio'
ranlux.F(.text+0xe84): undefined reference to `e_wsfe'
ranlux.F(.text+0xe88): undefined reference to `e_wsfe'
ranlux.F(.text+0x1288): undefined reference to `s_wsfe'
ranlux.F(.text+0x128c): undefined reference to `s_wsfe'
ranlux.F(.text+0x12a4): undefined reference to `do_fio'
ranlux.F(.text+0x12a8): undefined reference to `do_fio'
ranlux.F(.text+0x12c0): undefined reference to `do_fio'
ranlux.F(.text+0x12c4): undefined reference to `do_fio'
ranlux.F(.text+0x12dc): undefined reference to `do_fio'
/usr/local/cern/98/lib/libmathlib.a(ranlux.o)(.text+0x12e0):ranlux.F: more undefined references to `do_fio' follow
/usr/local/cern/98/lib/libmathlib.a(ranlux.o): In function `__g77_masterfun_ranlux':
ranlux.F(.text+0x135c): undefined reference to `e_wsfe'
ranlux.F(.text+0x1360): undefined reference to `e_wsfe'
collect2: ld returned 1 exit status
fort: Severe: Failed while trying to link.
albemuth:~/tth/pool> fort -v -otth tthnoqcd.f sage2.f
/usr/lib/compaq/cfal/decfort90 -o /tmp/for18985aaa.o tthnoqcd.f sage2.f
/usr/bin/cc -v -otth /tmp/for18985aaa.o -O3 /usr/lib/compaq/cfal/for_main.o -lUfor -lfor -lFutil -lcpml -lots
Reading specs from /usr/lib/gcc-lib/alpha-linux/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
/usr/lib/gcc-lib/alpha-linux/egcs-2.90.29/ld -m elf64alpha -G 8 -O3 -dynamic-linker /lib/ld-linux.so.2 -otth /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib/gcc-lib/alpha-linux/egcs-2.90.29 /tmp/for18985aaa.o /usr/lib/compaq/cfal/for_main.o -lUfor -lfor -lFutil -lcpml -lots -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
Reply to: