From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toon Moene To: ko Cc: gcc@gcc.gnu.org Subject: Re: linking Date: Sun, 06 Aug 2000 11:39:00 -0000 Message-id: <398DADB8.8E4B472@moene.indiv.nluug.nl> References: <398D0075.ECE10740@frontiernet.net> X-SW-Source: 2000-08/msg00148.html 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)