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]

Linking c and fortran code


I'm trying to build an application written in C and Fortran but am having
trouble linking the fortran and c object files.

I've compiled the c code with gcc under cygwin, and the fortran code with
microsoft's fortran compiler (there is a large amount of fortran 90 and 95
code which g77 doesn't grok). When linking the resultant object files, ld
can't find the required symbols for a few std fortran calls, a lot of Xt and
standard C calls (eg printf or strlen), and none of the c code seems to be
able to resolve symbols provided by the fortran code.

If I add an extra underscore to the required symbol names for at least
standard fortran calls to the object files for the fortran code, they
sometimes will resolve (so __foo instead of _foo).

I'm linking in the Mrm, Xm, Xt, Xaw, X11, SM, ICE, and math libraries (in
that order).

Should it be possible to link code like this? Is there anything I could
read to try to figure out what else I need to be doing? Or any suggestions
on what I've left out?

Sorry that this is a bit off topic; I asked the general cygwin group and
didn't get any responses.

a big thanks in advance!
-- 
Chris Frost  |  <http://www.frostnet.net/chris/>
-------------+----------------------------------
Public PGP Key:
   Email chris@frostnet.net with the subject "retrieve pgp key"
   or visit <http://www.frostnet.net/chris/about/pgp_key.phtml>


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