Hello everyone,
I’m developing an upgrade from Visual Fortran 6.0 to Visual Studio 2013. It is a dynamic library based on Fortran and C++ . The migration of the project is automatically made by VS2013, so, I only change the code to adapt it to new C++ standard and add "$(IFORT_COMPILER15)\compiler\lib\ia32" to Library WinRT Directories of Microsoft.Cpp.Win32.user.
First I build the C++ project obtaining a static library, after that, I compile the Fortran project with the static library to obtain the dynamic library. This step works and I obtain the dynamic library.
Then, I’m trying to run the dll file from another project but the code breaks when it is trying to get the addresses of the library functions. The code runs properly (this part of code) when it loads the Visual Fortran 6 library. So it should be the new dll.
// Attempt to load the specified dll m_hInstance = ::LoadLibrary(filename); HMODULE hm = (HMODULE) m_hInstance; if (0 == m_hInstance) goto cleanup; // Get addresses of all DLL functions m_pSI = (INITIALIZE*) ::GetProcAddress(hm, "Initialize"); if (!m_pSI) goto cleanup; m_pGC = (GETCOUNT*) ::GetProcAddress(hm, "GetCount"); if (!m_pGC) goto cleanup; m_pGP = (GETPERIOD*) ::GetProcAddress(hm, "GetPeriod"); if (!m_pGP) goto cleanup;
I am able to load the dll, but when I call to GetProcAddress function, I get NULL address. And we don’t know why it cannot get addresses.
Any suggestion of what can I do?
Information of fortran and visual studio:
- Visual Studio: Professional 2013, Version 12.0.21005.1
- Fortran compiler: Intel® Parallel Studio XE 2015 Composer Edition for Fortran, Version 15.0.0115.12
Thank you in advance,
Ibon