Building cocos2d-x-3.17 with Visual Studio 2017 hits 0x000007b

Hello dear forum!

I am trying to build cocos2d-x-3.17 with Visual Studio 2017 15.8.4 but am failing.

Commands I ran to create my project:
python setup.py
cocos new -l cpp -p com.gamefromscratch.gamename -d C:\path\to\game\here gamename
as stated here: http://www.gamefromscratch.com/post/2014/09/29/Cocos2D-x-Tutorial-Series-Installation-Creating-a-Project-and-Hello-World.aspx

First I tried to build but it told me I need to retarget the Windows SKD due to it trying to get some 8.1 or 6.1, so I put it to 10.0.17134.0.
Then it complained about “msvcr110.dll” missing, which is part of in my system32 though. Okay, so put a copy in my build-folder. I also have Visual Studio 2015 Redistributable installed.
And now, on both “Debug” and “Release” I hit following error when executing:

The application was unable to start correctly (0x000007b). Click OK to close the application.

Which seems to be related to missing DLL, so I assume that “msvcr110.dll” is incorrect or something?

I would be grateful if someone could help me : ) Thanks for your time!

So yes some user have performed

yep, one is to re-target.


and another point is:

for this issue, you should install Visual C++ Redistributable for Visual Studio 2015 / 2013 on official site, not put a copy in the build folder.

https://www.microsoft.com/en-US/download/details.aspx?id=48145

I think the reason is some prebuilt libs build times ago, so it depend on those component. @CuriousCocos

Hello, thanks for your replies but this actually confusing me a bit more.

I have “Visual C++ Redistributable for Visual Studio 2015” installed, it even complains about being already installed and yet still says “msvcr110.dll” is missing. I’m not sure… is it supposed to be automatically included?

Retargeting the SDK to Windows 10 does not fix this. I actually have no other SDK installed but 10.0.17134.0.

The other post said:

Retargeting does not solve anything for me sadly, as said related to that missing DLL.

When I pick v140_xp as toolset only, it complains about not being able to open a lot of header-files: stddef.h, stdlib.h, errno.h, …

With v140 and v141 it gives me the DLL-error.

Do you have the Windows SDK v7.1 installed? I vaguely recall having a similar issue, and had to install the Windows SDK v7.1. Getting it installed properly on Windows 10 was another issue, but in the end I did get it to work, but can’t quite recall what I had to do. There should be plenty of info on the net about it.

Here’s a link to it:
https://www.microsoft.com/en-us/download/details.aspx?id=8279

or here for the ISO:
https://www.microsoft.com/en-us/download/details.aspx?id=8442

I hope that helps in some way.

Thanks, it required me to do some registry-editing but I was able to install SDK v7.1.
Picked it in the toolset for every solution and then encountered some errors:

That is really odd. I just tested creating a project from scratch, and it’s all compiling and running fine. Here are the steps to how I created it:

I created a folder called “Test” on C: drive:

cd c:\test

Now you are in C:\test
cocos new -l cpp -p com.gamefromscratch.demo -d . demo
cd demo

Now you are in C:\test\demo

mkdir win32-build && cd win32-build

Now you are in C:\test\demo\win32-build

cmake .. -G"Visual Studio 15 2017" -Tv141

Now the solution and project files have been created in C:\test\demo\win32-build

You can open up the “TemplateCpp.sln” that is located in that folder in Visual Studio (should be demo.sln, but not sure why it is still TemplateCpp.sln, but that’s not important).

Right click the TemplateCpp project in that solution, and click “Set as StartUp Project”.

Build and run.

Does that work for you?

2 Likes

Yes!!! Wow, but why does not the way I create my project work? Very odd!

That’s good. I’m not sure how you were creating your project, but with Cocos2d-x 3.17, the way I described is the new way to create projects. As far as I know, the files in the proj.win32 folder may not work correctly, if that’s what you were using.

Refer to this:

http://www.cocos2d-x.org/docs/cocos2d-x/en/installation/CMake-Guide.html

1 Like

Here, I simply followed this: http://www.gamefromscratch.com/post/2014/09/29/Cocos2D-x-Tutorial-Series-Installation-Creating-a-Project-and-Hello-World.aspx
And did: cocos new -l cpp -p com.gamefromscratch.gamename -d C:\path\to\game\here gamename

Cocos2d-x 3.17 is probably a version where that does not work anymore?

The article was written in September 2014, using Cocos 3.3beta 0, so yes, pretty old. :slight_smile:

In saying that, the documentation on the Cocos2d-x website is also out of date in many places, so can be a bit misleading on how to set everything up.

@CuriousCocos could you to try to install this tools 2015 & 2013, both x86 & x64?

even your system is 64bit, you still need to install x86 tools, because the default build target is x86, which need x86 runtime.

Err what? Can you tell me what installation doc is out of date so I can test it please…

The primary installation and setup info that users would eventually find on first visiting the site is the document at this link:

http://cocos2d-x.org/docs/cocos2d-x/en/installation/

Now if you follow the links to the Windows documentation, you end up at:

http://cocos2d-x.org/docs/cocos2d-x/en/installation/Windows.html

then here:

http://cocos2d-x.org/docs/cocos2d-x/en/editors_and_tools/cocosCLTool.html

There is absolutely no mention of creating projects using the new method (CMake etc.). The “Compiling a project” section seems out-of-date.

Unless I’m looking in the wrong place, there are no other links from the front page http://www.cocos2d-x.org/products or http://www.cocos2d-x.org/cocos2dx besides the Documentation link, which takes you to the above.

Perhaps a more user friendly starting point would be beneficial, along with direct links to getting started in Cocos2d-x, at least for the installation part, because if that proves to be a source of friction, then users may give up and move on before they even give it a chance.

1 Like

Ok I see. Yeah I think we should integrate cmake now that the work is done and we support it. Good thought.

1 Like

I didn’t realise the previous method of creating projects was still being used, or that it even worked. When I upgraded to 3.17, I couldn’t get it to compile, with similar issues to the OP. That led me to the CMake project creation in a forum post here, and that worked instantly, so I just assumed that was new method we needed to use.

Anyhow, the transition to CMake made managing the different platform builds so much easier, with less platform specific makefiles and such. I wouldn’t want to go back to the previous method. :slight_smile:

glad to hear this, a bigger cmake refactor is in-progress #19054 .

1 Like