Windows Installation and Setup
A supported environment. See Installation Prerequisites
Setting up Cocos2d-x
You can get started with Cocos2d-x by either downloading a self-contained
.zip from the website or by cloning our
GitHub Repo. Pick what works for you.
There is no need to do both. Make sure you have a working environment. This means
a working Python, having run
By downloading a .zip archive
Download Cocos2d-x and unzip it. (maybe: c:\Users\your_user_id)
Cloning from GitHub
Use the following commands to clone our GitHub repo and get your environment setup. If you are not familar with GitHub's workflow, learn it or download using the step above, By downloading a .zip archive.
c:\<to where you want to clone this repo> git clone firstname.lastname@example.org:cocos2d/cocos2d-x.git git submodule update --init git submodule update ./download-deps.py
Compile and run the
Open cocos2d-win32.vc2012.sln in the build folder
Right click the TestCpp project, and select Set as StartUp Project.
Compile and run the TestCpp project.
Starting a new project
Once everything above works, you can start a new project! To do this, read our document on the Cocos Command-line tool.
Distributing a Cocos2d-x app on Windows
Note: this falls outside of the realm of Cocos2d-x. Please consult Microsoft resources for assistance.
If you try to run a game created with Cocos2d-x on a non-development machine, it may be required for this machine to have the Visual Studio runtime installed. The easiest way is to create an installer for your game, but it is possible to do it without by installing all required pieces manually.
Use Dependency Walker to check what DLLs your game requires.
Install the required Visual Studio runtime. Microsoft has now merged VS2015, 2017 and 2019 runtimes into one, which you can find here.
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.
Please see this F.A.Q for troubleshooting help.