Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LoadLibrary fails with error code 14001

Tags:

c++

visual-c++

I'm using Visual C++ 2008 Express Edition to create a resource only DLL. The problem I'm facing is that running the application that makes use of the DLL on another computer besides mine results in LoadLibrary() function failing with error code 14001.

Searching throught the internet it seems to be a dependecy problem of the computer running the application lacking libraries of the Microsoft Visual C++ 2008 Redistributable Package.

My first step was to install the latest Microsoft Visual C++ 2008 Redistributable Package but that didn't solved the problem.

Also I changed my project setting so the DLL compiles with static CRT linking assuming that this way I will get rid the dependencies.

These options seem to be the workarounds for other people having the same issue. Any idea in which direction to look is highly appreciated.

Thanks

==================================================================================

Thanks for your answers.

Both Dependency Walker and the event viewer indicated a side-by-side configuration problem as I was missing a debug version library of the VC++ Redistributable Package.

I was careless and have compiled my DLL in debug mode, recompiling in release mode solved the problem.

like image 742
tbk Avatar asked Nov 21 '11 02:11

tbk


2 Answers

Try to isolate missing library by Dependency Walker:

http://www.dependencywalker.com/

Just run your application on the second computer with this tool, it should tell you what library is missing. Be sure you are installing the right version of Visual C++ 2008 Redistributable Package; there are two of them, for VS 2008 with SP1 and without any SP...

like image 171
vitakot Avatar answered Oct 22 '22 14:10

vitakot


Look in the eventviewer. Good chance there will be an error there from Windows SideBySide explaining which assembly is missing.
Likely it would be a VC CRT runtime which you will have to bundle with your dll.

(the VC redistributable is available here: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=29)

like image 4
MK. Avatar answered Oct 22 '22 15:10

MK.