- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
I am using Visual Fortran Composer XE11 with Microsoft Visual Studio 2008. First of all, i would like to know if the FORTRAN compiler supports C calling convention.
My aim is to use the C API of an installed program called MOSEK through the fortran main code which i have already used through c++ code. I want to mention that for the running of this C code I have to set as header files "".h, which for sure I will need in the cooperation of 2 codes (C,Fortran). If this can not be done I wonder if it is possible to call a C program as a subroutine from Fortran code. thank you in advance.
hello,I am using Visual Fortran Composer XE11 with Microsoft Visual Studio 2008. First of all, i would like to know if the FORTRAN compiler supports C calling convention.My aim is to use the C API of an installed program called MOSEK through the fortran main code which i have already used through c++ code. I want to mention that for the running of this C code I have to set as header files "".h, which for sure I will need in the cooperation of 2 codes (C,Fortran). If this can not be done I wonder if it is possible to call a C program as a subroutine from Fortran code.thank you in advance.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort iso_c_binding supports cdecl, which has been "the" Microsoft C ABI for over 10 years, except possibly for Windows API access. There are examples of the latter supplied with the compiler.
It's always possible to write a C wrapper to call by cdecl, according to iso_c_binding (no C++ mangling) or otherwise, and use that to make a call via another calling convention. There are also examples including C++ symbol mangling.
It's always possible to write a C wrapper to call by cdecl, according to iso_c_binding (no C++ mangling) or otherwise, and use that to make a call via another calling convention. There are also examples including C++ symbol mangling.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel Visual Fortran uses the C calling convention by default. It supports all of Fortran 2003's C Interoperability features, which I recommend you use. I started a series of blog posts on this - you can find the first episode here.

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