6

I have a program that I am writing program.exe, it loads a dll lib.dll. When I run program.exe in debug mode everything works fine. When I try to run in release mode I get an error:

The procedure entry point ... could not be located in the dynamic link library lib.dll.

When I open the dll in dependency walker that exact function with all the same weird symbols is there. I looked at the module window in visual studio to make sure that I am not loading the dll from the wrong directory but that is not the case. I compiled both the dll and exe with the same compiler (Visual Studio 2012) so that is not the problem either. What could be causing this?

Edit:

I converted lib.dll into a static library and everything works fine. I give up!

Benjy Kessler
  • 7,356
  • 6
  • 41
  • 69
  • Perhaps this? http://stackoverflow.com/questions/16867607/the-procedure-entry-point-could-not-be-located-in-the-dynamic-link-library-loo?rq=1 – Bret Kuhns Dec 31 '13 at 13:17

2 Answers2

3

I ran into the same problem, and in my case, this was due to the fact that I had two versions of the same library installed on my computer.

In the end, the problem was that I was linking my program against the new LIB file while my PATH was pointing to the old DLL. When the library version number is not included in the LIB or DLL file names, it is very easy to mix the versions.

BConic
  • 8,750
  • 2
  • 29
  • 55
0

Try setting the path to the library in the property pages for Release builds too , when running a Release build.

AquaAsh
  • 176
  • 1
  • 5
  • 12
  • The path to the .lib file is set in the linker property pages, the problem isn't the .lib file I link properly. The problem is that the function in the .lib file is't found in the dll file. Even though when I enter the dll in dependency walker it is there. – Benjy Kessler Dec 31 '13 at 09:31
  • The best I can think of is of this reply, http://stackoverflow.com/a/495874/685445. Hope it helps. – AquaAsh Dec 31 '13 at 11:53