- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve, hi all,
it is so confusing what I find about mixing FORTRAN and C++
I have Visual Studio 2017 with Intel Parallel Studio XE 2018 and Microsoft Visual C++ 2017.
My FORTRAN-routine should call C++ routines. Can you tell me exactly how I can do that?
Thanks in advance!
Olaf
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fortran interfaces well with C. To the extent that you can make C++ look like C, it works pretty well. For C++ functions you call, you must use the 'extern "C"'' prefix in C++. You will be restricted to argument types supported by both languages.
A complete worked example is "Fortran_Calls_C" in the Intel Parallel Studio XE for Windows Samples Bundle (under compiler_f\MixedLanguage).
See also https://software.intel.com/en-us/blogs/2012/05/11/doctor-fortran-in-i-can-c-clearly-now-part-i - sadly, I never got around to writing Part II.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
oh, that's right. Thank you Steve, I will check this

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page