Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29252 Discussions

Link problems for mixed C/FORTRAN 32bit builds on 64bit machine

steve_reussansys_com
356 Views
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
0 Kudos
1 Reply
Steven_L_Intel1
Employee
356 Views

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.
0 Kudos
Reply