cocos2d-x-3.10 Required VS version : [2012, 2013]?

3.9 was working with VS 2015

Based on: cocos2d-x-3.10
Building mode: debug
Building…
Required VS version : [2012, 2013]
Can’t find correct Visual Studio’s path in the registry.

just to add this only happens when launched from cocos studio

1 Like

cocos2d-x 3.10 isn’t officially out yet since it’s not on the download page.

I assume you cloned the 3.10 branch on github?

I would wait until it officially comes out. it may just be missing some things until then.

actually it already is on the download page…

I didn’t see this. I assumed you downloaded cocos studio without a framework and tried to use it was a downloaded framework.

But I just tried it and it worked fine.

These are the settings I used when making the project

I mean that i cant run the game from cocos studio, from VS works fine
So what i want to say it that cocos studio cant find a suitable compiler.

1 Like

I am having same issue, any luck ?
I guess this is another bug.

+1

Could you fix it in the next release of Cocos Studio, @slackmoehrle?

Also not working in jenkins with the cocos cli tools, so probably not Cocos Studio related.

Edit: So it is project related. Our jenkins builds a 3.9 project fine while it doesn’t build the 3.10 project and gives the error about the VS version. Where is this specified in the project?

In my case, since I’m using vs 2012 express for windows desktop, cocos can’t find the devenv.com, so I need to change [cocos install folder]\Cocos2d-x\cocos2d-x-3.10\tools\cocos2d-console\bin\utils.py, inside method get_devenv_path, near the end of the method you will find the line

devenv_path = os.path.join(devenv_path, "Common7", "IDE", "devenv.com")

You will need to change it accordingly depends on your vs version, e.g. for me:

devenv_path = os.path.join(devenv_path, "Common7", "IDE", "WDExpress.exe")

Hope this helps

1 Like

I ran a diff on the tools folder and can’t seem to find the crucial part. Almost all of the code remained unchanged between versions. I also checked the cpp templates and could not locate where the applicable versions are set.

Could someone from the core developers clarify why this is happening? 3.10 cli tools compile a 3.9 project fine with VS 2015, but fail on a freshly created 3.10. Might as well open an issue for this on Github (here it is).

I’m also getting this when trying to compile cpp-tests in v3.10, using VS2015 Community.

C:…\cocos2d-x-3.10_for_tests\tests\cpp-tests>cocos compile -p win32
Building mode: debug
Building…
Required VS version : [2012, 2013]
Can’t find correct Visual Studio’s path in the registry.

Did anyone solve this?

I solved this problem.
Problem was in tools\cocos2d-console\plugins\plugin_compile\project_compile.py in lines from 916 to 926. There were two problems:

  1. because float(’%s.%s’ % (3, 10)) == 3.1. (3.1 < 3.7)
  2. r’cocos2d-x[^0-9]*(\d).(\d)’ not recognize two digits after dot.

So I change algorithm

    version_pattern = r'cocos2d-x[^0-9]*(\d)\.(\d)'
    match = re.match(version_pattern, engine_ver_str)
    if match:
        ver_float = float('%s.%s' % (match.group(1), match.group(2)))
    else:
        ver_float = None

    if ver_float is None:
        return ret

    if ver_float < 3.7 and self._platforms.is_win32_active():

to

    version_pattern = r'cocos2d-x[^0-9]*(\d)\.(\d+)'
    match = re.match(version_pattern, engine_ver_str)
    if match:
        ver_float = 100 * float('%s' % match.group(1)) + float('%s' % match.group(2))
    else:
        ver_float = None

    if ver_float is None:
        return ret

    if ver_float < 307 and self._platforms.is_win32_active():
7 Likes

That’s great. Thanks a lot.

Is there a PR for this on GitHub already?

I am not engaged in contributing, so it would be great if somebody will make the patch…)

Consider it done :wink:

Thank you (:

Well, has already been done and merged: https://github.com/cocos2d/cocos2d-console/pull/332

Great!

I keep trying to solve this issue but even though it’s supposedly fixed and merged I’m still getting this error. I have VS 2015 community and cocos studio v 3.10.