/usr/bin/ld: Undefined symbols:

jvsingh

Registered
Hi All

I am trying to compile a Fortran code on Mac OSX 10.4 ppc.
when I call using make, I get the following error.

g77 pmpb.f
/usr/bin/ld: Undefined symbols:
_MAIN__
collect2: ld returned 1 exit status
make: *** [pmpb.o] Error 1

Them Makefile lokks like this:

## Machine: Macintosh (PPC)
## CPU Type: PowerPC G4/G5
## Oper Sys: OS X 10.4 (Tiger)
## Compiler: GNU


#F77 = /usr/local/bin/g77
#F77FLAGS = -c
#OPTFLAGS = -O3 -ffast-math
#LIBFLAGS = -crusv
#LINKFLAGS = -g -ffixed-line-length-132

Could you please help me.

Thanks

Jay
University of Houston
Texas
 
file "pmpb.f" contains----

c ##############################
c ## ##
c ## subroutine apbsinitial ##
c ## ##
c ##############################
c
c
subroutine apbsinitial (dime,grid,gcent,cgrid,cgcent,fgrid,
& fgcent,pdie,sdie,srad,swin,sdens,
& kelvin,ionn,ionc,ionq,ionr,pbtyp,
& pbtyplen,pbsoln,pbsolnlen,bcfl,
& bcfllen,chgm,chgmlen,srfm,srfmlen)
implicit none
integer dime(*)
integer ionn
integer ionq(*)
integer pbtyplen
integer pbsolnlen
integer bcfllen
integer chgmlen
integer srfmlen
real*8 grid(*)
real*8 gcent(*)
real*8 cgrid(*)
real*8 cgcent(*)
real*8 fgrid(*)
real*8 fgcent(*)
real*8 pdie
real*8 sdie
real*8 srad
real*8 swin
real*8 sdens
real*8 kelvin
real*8 ionc(*)
real*8 ionr(*)
character*(*) pbtyp
character*(*) pbsoln
character*(*) bcfl
character*(*) chgm
character*(*) srfm
return
end
c
c
c #############################
c ## ##
c ## subroutine apbsempole ##
c ## ##
c #############################
c
c
subroutine apbsempole (n,pos,rsolv,pbpole,pbe,apbe,pbep,pbfp,pbtp)
implicit none
integer n
real*8 pos(*)
real*8 rsolv(*)
real*8 pbpole(*)
real*8 pbe
real*8 apbe(*)
real*8 pbep(*)
real*8 pbfp(*)
real*8 pbtp(*)
return
end
c
c
c #############################
c ## ##
c ## subroutine apbsinduce ##
c ## ##
c #############################
c
c
subroutine apbsinduce (indpole,pbeuind)
implicit none
real*8 indpole(*)
real*8 pbeuind(*)
return
end
c
c
c ###############################
c ## ##
c ## subroutine apbsnlinduce ##
c ## ##
c ###############################
c
c
subroutine apbsnlinduce (inppole,pbeuinp)
implicit none
real*8 inppole(*)
real*8 pbeuinp(*)
return
end
c
c
c ###################################
c ## ##
c ## subroutine pbdirectpolforce ##
c ## ##
c ###################################
c
c
subroutine pbdirectpolforce (indpole,inppole,directf,directt)
implicit none
real*8 indpole(*)
real*8 inppole(*)
real*8 directf(*)
real*8 directt(*)
return
end
c
c
c ###################################
c ## ##
c ## subroutine pbmutualpolforce ##
c ## ##
c ###################################
c
c
subroutine pbmutualpolforce (indpole,inppole,mutualf)
implicit none
real*8 indpole(*)
real*8 inppole(*)
real*8 mutualf(*)
return
end
c
c
c ############################
c ## ##
c ## subroutine apbsfinal ##
c ## ##
c ############################
c
c
subroutine apbsfinal
implicit none
return
end
 
I have not program Fortran for years, but it seems that your program does not have program... That is, it has several subroutines but no main routine (or as ld says:
Undefined symbols:
_MAIN__
)
 
Last edited:
Thanks. I am trying to compile it in another way, i am getting some -macosx_version_min unknown flag problem. the detail will be posted in new thread.
I would request you to have a look on that.
 
Back
Top