This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: linking
- To: ko <hsk at frontiernet dot net>
- Subject: Re: linking
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Sun, 06 Aug 2000 20:26:00 +0200
- CC: gcc at gcc dot gnu dot org
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <398D0075.ECE10740@frontiernet.net>
ko wrote:
> I bought a red hat a few weeks ago. I use gcc and g77 as it came from
> redhat. I have a problem in linking a simple c routinte to a simple
> fortran main routine. I attached these two very short files. I typed
> gcc -c intest.c
> g77 -c btest.f
> g77 -o btest btest.o intest.o
> I have error message saying that in Main_ undefined reference to
> bt_init_ is .
Close; the real error message is:
$ g77 ko.f ko.c
/tmp/ccMU89jz.o: In function `MAIN__':
/tmp/ccMU89jz.o(.text+0x6b): undefined reference to `bt_init__'
Note this: ^^
collect2: ld returned 1 exit status
$ g77 -fno-second-underscore ko.f ko.c
works OK.
This is covered by the manual, BTW.
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)