Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking object files mess!

Status
Not open for further replies.

milenko76

Technical User
Mar 26, 2010
100
PT
I have writen a makefile and managed to compile programs but...
f77 -o mt2d mt2d.o indat.o re2.o defpol12.o boufld.o koef3.o gaussr.o
mt2d.o: In function `MAIN__':
fort77-13793-1.c:(.text+0x1e3): undefined reference to `boumedcell_m__'
fort77-13793-1.c:(.text+0x3b9): undefined reference to `sflfld_m__'
fort77-13793-1.c:(.text+0x3d2): undefined reference to `koef3rhs_m__'
fort77-13793-1.c:(.text+0x445): undefined reference to `gaussrrhs_m__'
fort77-13793-1.c:(.text+0x4ed): undefined reference to `sflfld_m__'
Is it the compiler issue?
It is somehow related to underscore but do not know how.
 
The underscore is probably a red herring.

Possibility #1 the routines bournedcell sflfld ... are missing.

Possibility #2 ordering of object files. If indat has routines that boufld needs, they may not be included. You have to rearrange it as boufld first then indat

What were the compile options?

 
Thanks xwb.
Compiler options are:
F77=f77
FFLAG= -O3
I think that it is correlated with compiler I am using f2c,
I do not have g77 available.
 
Not sure what compiler f77 is. Can you just type

which f77

or if that doesn't work, whence f77

Then check whether it is a link and if it is, what it is linked to.

f2c generates C from Fortran code so that would probably be using gcc: not f77.
 
which f77,gives me:
/usr/bin/f77
I still have problem:
f77 -g -o mt1 mt1.o indat.o re2.o defpol12.o boufld.o koef3.o gaussr.o sflfld.o koef3rhs.o gaussrrhs.o surfce.o
mt1.o: In function `MAIN__':
/home/milenko/mt1/mt1.f:35: undefined reference to `indat_'
collect2: ld returned 1 exit status
I do not understand how is this underscore important.
 
indat.o: indat.f d2.dat
$(F77) $(FLAGS) -c indat.f -o indat.o
Part of the makefile.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top