The application was unable to start correctly (0xc000007b)

I tried all the things specified here and found yet another answer. I had to compile my application with 32-bit DLLs. I had built the libraries both in 32-bit and 64-bit but had my PATH set to 64-bit libraries. After I recompiled my application (with a number of changes in my code as well) I got this dreaded error and struggled for two days. Finally, after trying a number of other things, I changed my PATH to have the 32-bit DLLs before the 64-bit DLLs (they have the same names). And it worked. I am just adding it here for completeness.


It is a missing dll. Possibly, your dll that works with com ports have an unresolved dll dependence. You can use dependency walker and windows debugger. Check all of the mfc library, for example. Also, you can use nrCommlib - it is great components to work with com ports.


A load time dependency could not be resolved. The easiest way to debug this is to use Dependency Walker. Use the Profile option to get diagnostics output of the load process. This will identify the point of failure and should guide you to a solution.

The most common cause of this error is trying to load a 64 bit DLL into a 32 bit process, or vice versa.


Normally we get the 0xC000007B error-code (which means STATUS_INVALID_IMAGE_FORMAT), if:

  • If a 32-bit app tried to load a 64-bit DLL.
  • Or if a 64-bit app tried to load a 32-bit DLL.

To really know, I would suggest to test whether there is a problem between your application and its dependencies using dependency walker

Note that all you need to do is open your App using said tool, and issues appear as red log-entries at buttom of screen.

(At least, at time of writting, namely 2022)

Also, make sure you run the correct version of Dependency Walker, for example, the x86 version will display incorrect results when openning x64 binaries.