This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Undefined symbols: ...from: _main in libgfortranbegin.a(fmain.o)
- From: Tim Prince <TimothyPrince at sbcglobal dot net>
- To: Margaret Doll <margaret_doll at brown dot edu>
- Cc: fortran at gcc dot gnu dot org
- Date: Tue, 06 Jan 2009 08:31:44 -0800
- Subject: Re: Undefined symbols: ...from: _main in libgfortranbegin.a(fmain.o)
- References: <5022A394-BAAE-448B-B0A5-61B41C06F6D6@brown.edu>
- Reply-to: tprince at computer dot org
Margaret Doll wrote:
> Please email me back at margaret_doll@brown.edu
>
> I have recently installed gfortran on a couple of Intel Macs running
> 10.5.6. The developer's tools were installed on both.
>
> I am getting the following error:
>
> gfortran TailSum.f -o tailsum
> Undefined symbols:
> "_MAIN__", referenced from:
> _main in libgfortranbegin.a(fmain.o)
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
>
It seems that you don't have a Fortran main program, the one which begins
(since 30 years ago) with
PROGRAM yourprogram
or, if you do, some error has prevented it from compiling correctly.
If you were making only an object file, for use in some other program, you
would need -c option.