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

Linking Fortran DLL VS 2010 in C++ VS 2008

sjur
Beginner
748 Views
Hi,

I´m having a problem with linking a Fortran DLL created in VS 2010 V12.1 into a C++ code created with VS2008. The DLL does not seem to load. Is it not compatible when calling a DLL created with a newer version of Visual Studio?

I found the thread below that discuses the oposite problem. Is these problems related?
0 Kudos
3 Replies
Steven_L_Intel1
Employee
748 Views
What exactly goes wrong?  Do you get an error message?  There is nothing "incompatible" but you must satisfy the normal requirements of DLLs, such as having any dependent DLLs present and findable on the system.
0 Kudos
sjur
Beginner
748 Views
The DLL i´m making will go into a external program i do not control. But my partners on the C++ side say that the DLL only returns garbage, bad pointers etc and the DLL is actually not loaded only the library. The claim that this is on the VS side and i need to change version from 2010 to 2008. I can not really understand this. Does the VS version affect how the DLL is compiled? If so is it possible to change the platform in 2010 to 2008?
I hope you can understand my problem.
0 Kudos
Steven_L_Intel1
Employee
748 Views
What is affected by the VS version is which version of the MSVC DLL is linked in. If your DLL is being used on another system, that system must have the appropriate MSVC redistributables installed.  However, if you know that your DLL will be not be called from Fortran, you can set the option Libraries > Use Runtime Library > Multithread (and not Multithread DLL).  This will link in static libraries and remove dependencies on the MS DLLs.

I don't quite see how the DLL can both not load and return garbage, though.
0 Kudos
Reply