I have created a DLL from Haskell code and I am calling this DLL from C++. My application works fine when I run it in Debug mode in Visual Studio 2010, but when I make a Release build and install it, I get the error
The procedure entry point GetDataChunk could not be located in the dynamic link library AdvancedMath.dll.
AdvancedMath.dll is my Haskell-based DLL. The weird thing is that the function GetDataChunk isn’t in that DLL—it’s in another DLL I link against, and nothing about that DLL or my application’s use of it changed when I added the Haskell DLL.
This error message seems to be saying that Windows is confused about which functions live in which DLLs. What could be going wrong here?
To resolve the problem, first search all drives for any duplicates for the exe or DLL file reporting the error. Delete any duplicate files stored in user directories. This action resolves most problems.
This error is mostly caused by a corrupted dll file, other configuration files, drivers, or a bad configuration and can be fixed by either fixing or replacing the dll files, performing a system restore, reinstalling a fresh copy of the application, or updating to the latest version.
On some versions of Windows, the error "CreateProcessWithTokenW could not be located in the dynamic link library ADVAPI32. dll" can be solved by installing the Adobe Acrobat and Reader update. Run a virus/malware scan of your entire system.
This looks to be a bug in Visual Studio 2010 Release mode (Haskell dll functions are not imported by exe built in Release mode hence Haskell dll is not loaded, in Debug imports are present and it works fine).
The same exe project built in Release mode using Visual Studio 2013 Update 4 and Visual Studio 2015 RC works fine.
Have you tried using .def file to define exports? https://msdn.microsoft.com/en-us/library/d91k01sh.aspx
After you create it, you must edit project properties Linker->Input->Module definition file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With