This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: undefined reference to `MAIN__'
- From: Ian Lance Taylor <iant at google dot com>
- To: chao sun <1988sunchao at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 25 Aug 2009 06:24:44 -0700
- Subject: Re: undefined reference to `MAIN__'
- References: <5a6ed0a80908242111k3ebea3e5rce35f01bf41a42bf@mail.gmail.com> <5a6ed0a80908242157y14ab4f98hc7565808743d69c1@mail.gmail.com>
chao sun <1988sunchao@gmail.com> writes:
> After I seted up the Fortran/C compilers and conducted âmakeâ the
> error message as follows came out::
>
> gfortran -o prep_chem_sources \
> ÂÂÂ prep_chem_sources.a ..//utils/bin/libutils-2.0-opt.a
> -I/usr/local/include -L/usr/local/lib -lnetcdf
> /usr/lib/gcc/i586-redhat-linux/4.4.0/libgfortranbegin.a(fmain.o): In
> function `main':
> (.text+0x27): undefined reference to `MAIN__'
> collect2: ld returned 1 exit status
> make: *** [prep_chem_sources] Error 1
This means that you are missing a "program main" in your Fortran code.
Or something like that--I'm not a Fortran programmer.
Ian