This is the mail archive of the gcc@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]

Re: linking


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)

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