This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fmain.c:21: undefined reference to `_MAIN__'


Tim,

good suggestion - nm shows that there's infact NO main!
Turned out that there were some weird chars in my mymain.f90 source
Thanks for the good lead.

H

Tim Prince wrote:
Hans Horn wrote:


Compiling works: gfortran -c a.f90 b.f90 mymain.f90

When I try to link:
gfortran -o mymain a.o b.o mymain.o

I get

/usr/local/gfortran/lib/gcc/i686-pc-cygwin/4.3.0/libgfortranbegin.a(fmain.o): In function `main':
../../../gcc43/libgfortran/fmain.c:21: undefined reference to `_MAIN__'

If you actually have a main program (PROGRAM or f66-style implied PROGRAM), _MAIN__ should be present in that .o file, and visible to nm or objdump.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]