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

Mixed programmng confusion

Hello ,
I am dealing withmixed programming with fotran and C using MS VC++6.0 . I am writing C modules for a Tool written in Fortran. A C function calls a Fortran subroutine and this Fortran subroutine calls another subroutine which is defined in a fortran static library. And I add path of this library as an external library to Project/settings/link/category:Input/"Additional library path".
However, I have still a LNK2001 error-Unresolved external symbol _X_.
X is the called function(written in fortran) which is called by the fortran subroutine.
I am thinking that the 'unresolved external symbol error' is shown
only with one underscore that is _X. why there is the second underscore(_X_)? And I don't know how to solve this.
I would be very happy ifanyone can help me..
Cheers ,
0 Kudos
1 Reply
Honored Contributor III

If your C code is written for the usual BSD/f2c calling convention (as used by Intel linux compilers), it may have the underscore appended explicitly, or by some #define pre-processing. If so, you will need to adjust the names either in your C or your Fortran code so they match. The Windows utility

dumpbin /symbols *.obj

should help you determine what is needed to make them match.

0 Kudos