This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: multiple definition of `MAIN__'


Fabian Braennstroem wrote:
Hello,

I am still trying to adjust an sgi-fortran-code to linux g77.  I get
this error-message:

main.o(.text+0x10c3): In function `MAIN__':
: undefined reference to `save_vel__'
main.o(.text+0x10d2): In function `MAIN__':
: undefined reference to `save_pres__'
collect2: ld returned 1 exit status
make: *** [calc_les_03_cube] Error 1

Without the two subroutines 'save_vel.f''save_pres.f' the program works
well.

Did you compile save_vel.f and save_pres.f with g77 as well ?


Note that g77 appends two underscores to the name of a subroutine that contains an underscore.

If you just assume the loader will get save_vel and save_pres from a library compiled with another compiler that doesn't append the extra underscore, you're out of luck.

Anyways, don't assume g77-compiled code and code compiled with another compiler on your SGI machine will work together flawlessly, even if the loader phase succeeds ...

Hope this helps,

--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)


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