0xc000007b Error Solution

Two days ago I was working on a C++ project using OpenCV, when suddenly my project couldn’t run anymore!

I just have changed my OpenCV dlls to parallel version and ended up with this Error: "The application was unable to start correctly (0xc000007b). Click OK to close the application." every time I tried to run my application.

0xc000007b-error

After some hours of hard search I found that 0xc000007b error didn’t come from an exception in my code or even OpenCV dlls. I found that the error is just wrong configurations and the solution is easy, so I decided to write this article to show you how you cans solve this error permanently.

The Problem

0xc000007b error comes mainly from mixing up 32bit environment with 64bit one, that is you have an 32bit application that tries to load a 64bit dll.

To see exactly who cause this you must examine your application dependencies carefully.

I used a free portable program to do this: "Dependency Walker". After you download it you can open any PE file (exe, dll, …)

Open your application executable file (in my case "testopencv.exe") with dependency walker, you sould see something like this:

dependency-walker

As You can see, dependency walker shows all dlls my application depends on, and all dlls these dlls depends on and so on…

Now you must check these dlls to see which one is 64 bit? If your application works fine you should see nothing, but when your application throws 0xc000007b error that means you have at least one 64 bit dll in these dlls.

In my case as you see, my application depends on cv2010d.dll which depends on tbb_debug.dll which is 64bit dll (notice the 64 number near its icon). You can see the properties of any dll to find its path, my tbb_debug.dll lies on: "E:\Intel\Compiler\11.154\tbb\intel64\vc9\bin".

The Solution

But why cv2010d.dll links to 64bit version of tbb_debug.dll instead of 32bit one? and how can we change that?

The answer is that most exe or dll have it is dependencies names only not their paths (that is what we called dynamic linking). So finding the real path of these dependencies done in runtime, and in our case that cause the problem.

When I run my application it tries to load cv2010d.dll which tries to load all of its dependencies including tbb_debug.dll. System tries to find tbb_debug.dll 32bit (because my application is 32bit) but when it can’t it tries to find 64bit version and it can, so it tries to load it and here is the error comes from.

To solve this I remove "E:\Intel\Compiler\11.154\tbb\intel64\vc9\bin" from the PATH variable, so when I tries to run my application system can’t find any tbb_debug.dll (neither 32bit nor 64bit version) so it throws a new error now says that tbb_debug.dll is not found.

The last step I made was coping the 32bit version of tbb_debug.dll and but it near my application executable file so now when system tries to load tbb_debug.dll it will find the 32bit version of it (also dependency walker will do that so there isn’t any 64bit dll in my dependencies now) and my application comes back to life again.

Advertisement

30 Responses to “0xc000007b Error Solution”

  1. Dan Says:

    0xc000007b error

    Download and install the following to fix 0xc000007b error.

    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84

    • Madhat Alsoos Says:

      I don’t think it is enough. When error 0xc000007b occurred on my pc, “Microsoft Visual C++ 2005 Redistributable” & “Microsoft Visual C++ 2008 Redistributable” were already installed.
      I am sure that you must have a version of Microsoft Visual C++ Redistributable installed on your pc, to solve 0xc000007b error but that is not enough.

  2. guest Says:

    Dan solution worked for me :)
    Thank you

  3. Cog Says:

    i did what it said and there are no 64bit ddls
    but when i try to open my file it starts but says
    ‘supermeatboy.exe has stopped working’
    can you help?

  4. Dugan Chen's Homepage Says:

    [...] you get the 0xc000007b crash when you run your application on another computer, then you just need to distribute the [...]

  5. oki from ina Says:

    thank’s dude it’s work, very thank you

    regards
    oki

  6. Adi Says:

    I tried to use “Dependency Walker”, i see on left panel … there’s no 64 bit warning, but i still got those error
    pls replied me …. thx Dan

  7. mcormic Says:

    umm where is the path variable

  8. Danilo Pena Says:

    Perfect!

    Just adding, if the error persists, even after putting the .dll in the correct version, then it may be an error code. eg: use imread() of the wrong way, err on the filename.

  9. zhuoliang Says:

    Very nice!

    Thanks!

  10. Toma Says:

    Thanks helped me. I was build my application in x64 (Any CPU), just change it to x86 and works like a charm, THANKS! :)

  11. Roberto Says:

    To me something similar happens, but I think directx’s fault, since the simulator and installed no problem but when you are installing the direcx I get this error:
    Your computer does not have the d3dx9_43.dll, try reinstalling the application.
    No application refers to, I uninstalled the a-10 and I’ve reinstalled a few times, but always I get the same.
    Can anyone tell me how I can fix it?
    Incidentally this happens to me since I format the computer.
    My team is:
    Windows 7
    4Gb Ram
    1TB HD

  12. yb kwon Says:

    very thx it was helpful

  13. weish Says:

    THANK YOU! I was getting insane about this… copying the .dll in directorie, works for me

  14. Mateo Says:

    My gpsvc file is running on a x64, however, I cannot delete it or modify it or anything! any help?

  15. anthony soon Says:

    i having this same problem but is during windows start up meaning when i log in, my screen is black and i cant see anything.
    Any solution for my problem?

  16. anthony soon Says:

    at the same time, all my other function is not working meaning all hiving me the error 0xc000007b thus giving no control of anything in my computer. the task manager and the safe mode is also having the same problem

  17. udit Says:

    i really dont know much about computers..i tried to install halo 2 and first it said d3dx9_31.dll is missing..i found the dll and pasted it in the applications folder..then it gave the0xc000007b error..it dosent even begin installation..i tried to run it in compatibility mode also but the same results..pls help..

  18. Download Says:

    Thanks Dan, Work For Me

  19. Su'ana Mompittseh Says:

    I get the 0xc000007b Error when I try to start up Fable- the lost chapters, on my windows 7, 64 bit computer.

    I got the Dependency walker, and it showed some missing dlls, and I put those in, then it showed some different bits, x86 and x64

    The problem I am having, is that the above OP reads that there is an error solution, and I read it again and again, and cannot see any solution in there. There is a description of what happened and what it means in the “solution” but not how to actually change the dll bits or whatever needs to be done.

    Maybe it is that I am not computer programmer, minded, where changing data is not easy for me, maybe it is in code.

    Maybe someone could dumb it down for me.

    • Madhat Alsoos Says:

      In my “solution” I didn’t change “dll bits”. 0xc000007b error occurred because of loading the wrong dll version. What I did is just force the exe to load the 32bit version of dll instead of 64bit version, that is all.

      • Su'ana Mompittseh Says:

        Thanks for replying!
        I didn’t even know if changing dll bits is something that can even be done. I was just trying to sound informed. But what I need to do is force the exe to load 64bit versions on some files that are loading 86bit versions, or so it seems from the dependency walker.
        I don’t know how to do what you said you did. And if I have so many 86bits and so many 64bits, do I need to find 64bit versions of the 86bit versions, or is there a way to just convert them?

      • Madhat Alsoos Says:

        Yes you need to force your exe to load one kind of dlls (if your exe is 64bit then it should load 64bit dlls) and you can’t convert 32bit to 64bit or via-verse you should download or find a new dll from the souce you get the first one.
        The easy way to force the exe to load your dlls is to put them all at the same directory with it and make sure that there is not any other versions of these dlls that your exe can access using the PATH system variable folders.

  20. Elias Gerber Says:

    Thanks for your blog! I didnt read all the details, but thanks to this entry I started examining the problem with DependencyWalker. Maybe this helps someone else:

    As I did not copy the correct 32-bit dll to the location of the .exe file created by my project, It loaded the dll from c:\program files\intel-wireless-driver. As I’m using a 64bit os this dll was 64bit, while my application is 32bit. So, copying the 32bit dll to the same dir where my .exe is, solved the problem.

  21. hocu Says:

    thank you very much
    have good works

  22. leo Says:

    You are a hero!

  23. Patrick Lange Says:

    It didn’t work for me Dan. I’m still getting the error :( I don’t know how it’s working for other people.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.