user5093757
user5093757

Reputation: 51

LoadLibrary return 193 on newest version of Visual C++ on x64

I have a problem with LoadLibrary (load dll library), problem occur after migration from Visual C++ 2008 to Visual C++ 2012.

When I try to use LoadLibrary on my dll I have an error (GetLastError return 193), which is strange because in old visual there is no problem with the same dll (x64 on both visual is set).

Upvotes: 1

Views: 3559

Answers (1)

Sebastian Redl
Sebastian Redl

Reputation: 72044

193 is ERROR_BAD_EXE_FORMAT, which means that the DLL you're trying to load, or one of its dependencies, is not a valid executable, or possibly a 32-bit executable. So you probably have some misconfiguration in your build.

You can use a tool like Dependency Viewer to check the executables to see if they match.

Edit: Here's the description for 14001:

//

// MessageId: ERROR_SXS_CANT_GEN_ACTCTX
//
// MessageText:
//
// The application has failed to start because its side-by-side
// configuration is incorrect. Please see the application event
// log or use the command-line sxstrace.exe tool for more detail.
//
#define ERROR_SXS_CANT_GEN_ACTCTX        14001L

So it definitely appears to be a DLL dependency issue.

Upvotes: 1

Related Questions