What is the best way to call a Microsoft C++ routine from Intel Visual Fortran? I would prefer to create a MS C++ library and then link it into my application and call it direct rather than making a C++ DLL and then calling the DLL.
链接已复制
Apologies if it was too broad. I would prefer a MS C++ static library that I would just call from Intel Fortran. I would just set up a data structure in the Fortran and pass its pointer to the C++ routine which would contain an equivalent structure. How to pass the data back and forth is not a problem.
The main thing I'm unsure about is what pragmas, etc are required in the Fortran and C++ so that they link and communicate with each other properly.
For usage of BIND(C) there are useful examples you can find by search engines (perhaps as ISO C interop). Fortunately, this is an aspect of Fortran which generally is treated accurately. Multiple rank arrays aren't so pretty.
schulzey wrote:
Apologies if it was too broad. I would prefer a MS C++ static library that I would just call from Intel Fortran. I would just set up a data structure in the Fortran and pass its pointer to the C++ routine which would contain an equivalent structure. How to pass the data back and forth is not a problem.
The main thing I'm unsure about is what pragmas, etc are required in the Fortran and C++ so that they link and communicate with each other properly.
See this thread on this forum, quote #6 for an example:
https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/699941
