Application Returns 0xc000007b on launch by a user, see post for details

For whatever reason, when I send a friend (non developer) a program that I make in cocos, he can’t run it. I think I’ve pinned the issue to the program being built in win32 when his computer has a 64 bit OS.

I’m wondering how to build cocos in 64 bit so that I can send him my programs. I haven’t really explored cocos’ command line and I’m ignorant to most of what cocos can do, so any help is appreciated.

No 32 bit is fine. I think you are missing the redistribution libraries. Search these forums for this and using an installer program.

I’ve included all required dependencies, including all cocos libraries, VCRUNTIME140d, VCRUNTIME, and ucrtbased. Please see below:

I’ve done a bit more research and found that a friend of mine was able to run the program on a windows 7 PC. The SDK being used in the VS project is the windows 7 SDK, and for some reason i cannot change the version to windows 10. Is there something specific I need to do? (As of this post I am editing the topic title)

VCRUNTIME140d.dll is a debug DLL, which is not meant for re-distribution at all. By including all dependencies, do you mean you’ve bundled up all the extra DLLs you found are required (did you use Dependency Walker?). If so, you really shouldn’t be doing this, and you should simply install the required Visual Studio runtime. The 140 version is the VS2015 C++ Runtime, but I think MS now merged VS2015, 2017 and 2019 runtimes into one, which you can find here:

https://support.microsoft.com/ms-my/help/2977003/the-latest-supported-visual-c-downloads

Make sure you get your friend to install the vc_redist.x86.exe version of the runtime.

Also, give your friend the release version, not the debug version. If you absolutely must use the debug version, then use Dependency Walker to figure out what else you may be missing.

You also should mention which version of Cocos2d-x you’re using, along with which version of Visual Studio, and how you actually created the build. Did you use CMake to create the project files?

1 Like

First things first: I built the program in release, I was just never sure which version of VCRUNTIME to include so I put both of them into the folder with the game’s exe, the resources folder and the cocos libraries.

Secondly, the friend that I mentioned in my previous post did not have to download the runtime that you linked. The dll’s I had given them were sufficient, and they were able to run my game perfectly fine.

my version of cocos is : 3.17.1
I am using the latest version of VS community 2017 (15.9.13)
I created the project using an executable called “CocosProjectCleaner.exe”
I am not entirely certain on how this executable works, but when it was done running it had made a visual studio project for me and copied / created a bunch of folders for me


The visual studio project is inside the proj.win32 folder:COCOS

I should also mention that the error this friend gets when he tries to run this program is 0xc000007b
He was able to run any other C++ programs that I made in visual studio that were not made in cocos

What is this even?

It is an executable that does exactly as I’ve described. If this is the root of the problem, than can someone point me in the right direction when it comes to making a cocos project in visual studio normally? Do I have to use CMake?

Well I don’t even know what CocosProjectCleaner is. I’ve never heard of it in the 7 years I have been here.

Alright well, with that being said, I guess I should create a new cocos project now. I’m guessing I either have to use CMake or the command line? Again im very new to this part of cocos, so please forgive me for asking potentially obvious questions

Yes run cocos new and create a new project. You can then use cmake if you wish.

Also where did you find “CocosProjectCleaner.exe”

You really should avoid copying those Microsoft VC++ runtime DLLs into your project, regardless of what advice you may see posted online. The MS VC++ re-distributables are made for this specific purpose, which is what you should be including with your application, and the installer you create can take care of installing it along with your application if required (most of the time it’ll already be installed as a dependency by another app).

Also, I have no idea what CocosProjectCleaner.exe is. What is the purpose of the application?

1 Like

using the command you mention created the exact same project as the one that was created by the “Cocos Project Cleaner”. The SDK version of the project is still Windows 7.


I have now realized my mistake. The underlined portion of the picture shows that the VS runtime being used was apparently by default set to windows XP. I’ll do some more testing on my friend’s computer and come back with results now that I know this.

That executable was given to me by a friend, and I don’t know the origin

What is the reason behind that?

I mentioned in a (currently pending) reply that the that executable does exactly the same thing as the command “cocos new”

If you add the DLLs into the release folder, and there are issues discovered within the MS DLLs (security issues/incompatibilities etc), then the only way the user gets those updates is if you release a new version of your application. If you install the VS C++ runtime provided by MS, then the user can receive critical updates to it automatically via Windows Update.

Ah, okay, makes sense to me. Thank you so much. I guess I should figure out how to make an installer then.

For the installer, check these posts:

InnoSetup (also shows you a sample for how to install the VS C++ runtime using it)

Sample InnoSetup script for Cocos2d-x here.

1 Like

I feel like at this point I should change the name of the thread again, so I will do so.
Here’s a picture of the planned deployment folder. COCOS
Once again, the error my friend gets is 0xc000007b. The program is now built in the windows 10 SDK in the win32 configuration, my friend’s computer is running a 64 bit version of windows, and I will be working on the aforementioned installer soon.
Is there absolutely anything that I am doing wrong here? (Besides including the VCruntime, I’ll fix that when I make the installer) I tried including the four dll’s mention in the post that @R101 linked earlier, and sadly nothing changed. Any responses are appreciated.

Are all your resources (graphics, fonts, sounds) being included in when building?

Also, what about any permissions issues.

Can you check event viewer and see more details about this. Should be time stamped.

I guess I can build 2 vms and try building one and then running in another plain vm

The fact that you are running a Win32 app on Windows 10 64Bit is not an issue, so don’t focus on it. There is something going on with your friend’s PC, because 0xc000007b is a very generic error condition, and it could mean many different things, including corrupt files on that PC, whether it be Windows files, C++ runtime files or even a virus scanner causing the issue.

Any chance you could get your friend to install VS2017 (or VS2019), and then build and run the release version on that PC to try to catch the issue. Read the info here for how to debug a release version.