Re: how to call C (non-intel C compiler) from ifort (intel fortran)?



ktrchang@xxxxxxxxx wrote:

I need to call C within fortran code. I could compile and link using
Visual Fortran and Visual C++.

CALL SUB1(arg1, .......)

C code is like:
#define sub1 __stdcall SUB1
void sub1 ( arg1, ........)

Now I have to use another machine with Intel Fortran (ifort)
> with .NET (Visual Studio 2005). When I linked, I got error message
> "unresolved external symbol _SUB1".

It is not unusual for Fortran subroutine and function names to
be generated with an extra _ on them. Also, since C is case sensitive
and the routine in the message is upper case change the C routine
name to _SUB1.

#define sub1 __stdcall _SUB1

-- glen

.