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

BIND(C) and !DEC$ ATTRIBUTES C

Martin__Paul
New Contributor I
425 Views

I have a Fortran project with calling convention CVF specified in project properties, which I understand equates to stdcall except CVF passes scalars by reference. Fortran calls a C++ function which uses cdecl. I am using BIND(C) attribute which I am assuming defaults to cdecl. If I change the C++ convention to stdcall, do I have to declare !DEC$ ATTRIBUTES REFERENCE, STDCALL, ALIAS: 'Init' :: Init in the function block, or is there an alternative to BIND(C) which works for stdcall?

0 Kudos
2 Replies
Steven_L_Intel1
Employee
425 Views

We do not allow the use of ATTRIBUTES STDCALL with BIND(C). If you are calling STDCALL routines, you'll need to use ATTRIBUTES to specify everything as you show it.
0 Kudos
Martin__Paul
New Contributor I
425 Views

We do not allow the use of ATTRIBUTES STDCALL with BIND(C). If you are calling STDCALL routines, you'll need to use ATTRIBUTES to specify everything as you show it.

Thank you for the swift response!

0 Kudos
Reply