g++ and g77 linking problem, gcc-2.95.3
Dan, Ho-Jin
hjdan@cais.kaist.ac.kr
Mon Apr 16 06:24:00 GMT 2001
fortran file was compiled with g77 and c file with g++ instead of gcc.
gcc & g77 combination was good with linking flags -lg2c -lm but
g++ didn't work. my test program was build as below,
---makefile
fcallc.o : fcallc.c
g77 -c $<
subr.o : subr.c
gcc -c $<
fcallc : fcallc.o subr.o
gcc -o $@ fcallc.o subr.o -lg2c -lm
#also tested g++ -o $@ subr.o fcallc.o -lg2c -lm
I could't change gcc to g++ because ld complained as
fcallc.o(...) : undefined reference to 'subrt_'
any idea? thanks in advance...
More information about the Gcc-help
mailing list