Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

“The procedure entry point… could not be located” in the wrong DLL

Tags:

c++

haskell

dll

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?

like image 944
bdesham Avatar asked Jul 14 '15 20:07

bdesham


People also ask

How do I fix a dynamic link library error?

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.

How do I fix the procedure entry point steam controller could not be located in the dynamic link library?

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.

How do I fix the procedure entry point could not be located in the dynamic link library ADVAPI32 DLL?

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.


2 Answers

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.

like image 173
doqtor Avatar answered Sep 22 '22 02:09

doqtor


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

like image 35
Caldur Avatar answered Sep 23 '22 02:09

Caldur