- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've got a mix of C and FORTRAN that has a C mainline, which calls routines in a FORTRAN library, which in turn calls routines that exist in a C library. I am building on an XP64 machine using IFORT 10.1.021 in visual studio.
Everything works fine when building a 64bit configuration, but I'm having problems linking a 32bit configuration. In particular, all of the external subroutines/functions defined in the C library are not being resolved when the FORTRAN library is linked into the C mainline. I get a "error LNK2019 : unresolved external symbol _CLIBMETHOD referenced from function _FLIBMETHOD" when the FORTRAN library is linked into the C mainline.
A dumpbin of FORTRAN library shows external dependencies on _CLIBMETHOD. A dumpbin of the C library shows symbols like _CLIBMETHOD@0.
I'd thought that there was some sort of lead uderscore problem, but now that I look at the C lib symbol, I can't help but wonder if its the extra @0 that's the source of my problems...
Thanks in advance for any help/advice,
Steve
Everything works fine when building a 64bit configuration, but I'm having problems linking a 32bit configuration. In particular, all of the external subroutines/functions defined in the C library are not being resolved when the FORTRAN library is linked into the C mainline. I get a "error LNK2019 : unresolved external symbol _CLIBMETHOD referenced from function _FLIBMETHOD" when the FORTRAN library is linked into the C mainline.
A dumpbin of FORTRAN library shows external dependencies on _CLIBMETHOD. A dumpbin of the C library shows symbols like _CLIBMETHOD@0.
I'd thought that there was some sort of lead uderscore problem, but now that I look at the C lib symbol, I can't help but wonder if its the extra @0 that's the source of my problems...
Thanks in advance for any help/advice,
Steve
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, the @0 indicates that the Fortran library is built using the STDCALL calling convention. Perhaps this was a CVF project converted to Intel Fortran?
Right click on the Fortran project, select Properties. Expand the property tree Fortran > External Procedures. Change Calling convention to Default. Change String Length Argument Passing to "After All Arguments". Rebuild.
By the way, it is Fortran, not FORTRAN.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page