Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2012 Error: The application was unable to start correctly (0xc000007b)

I received the error "The application was unable to start correctly (0xc000007b)" after attempting to run my exe file of my C++ SFML 32-bit program I built in Visual Studio 2012. I statically linked the SFML dlls in my project, but incorporated the following dlls along with my program:

libsndfile-1.dll
openal32.dll
msvcp110.dll
msvcp110d.dll
msvcr110.dll
msvcr110d.dll

What is the problem?

like image 630
user3236245 Avatar asked Jan 25 '14 21:01

user3236245


People also ask

What does code 0xc000007b mean?

Reasons of Windows error code 0xc000007b The error code means an invalid image format. Specifically, you are attempting to start an application which is designed to run on 64-bit operating system. But your computer is running 32-bit Windows.


3 Answers

The actual error code that you encountered is 0xC000007B. That is the NTSTATUS error code STATUS_INVALID_IMAGE_FORMAT. That error arises, almost invariably, because the application is 32 bit and attempted to load a 64 bit module, or vice versa. In your case, you state that your application is 32 bit, so it seems that it is attempting to link to a 64 bit DLL. Use a tool like Dependency Walker to diagnose the module which has the wrong bitness.

I don't understand why you are distributing both release and debug versions of the MSVC runtime. You only need one, and that one should be the release versions. The files that end d are the debug versions. You are not permitted to redistribute them.

like image 75
David Heffernan Avatar answered Sep 28 '22 14:09

David Heffernan


Error code 0xC000007B can also result if you run an application that has erroneously been statically linked with a .lib file that is an import library corresponding to a .dll (as opposed to a .lib file that is a static library). If you want to know more about the differences between a static library and an import library, see Why are LIB files beasts of such a duplicitous nature?

like image 44
Glen K Avatar answered Sep 28 '22 15:09

Glen K


I was also facing the same problem yesterday. Then I installed the Redistributable setup for VS i.e. vc_redist.x86 for 32-bit machine, after that application start running. You can use either 32-bits or 64-bits setup according your machine.

May it'll help you. Thanks

like image 40
Ashmita Chaudhary Avatar answered Sep 28 '22 15:09

Ashmita Chaudhary