cocos2d-x Windows environment to build

This article cocos2d-x version is not a big difference after 3.14,3

Python environment

Because of the need to use several .pyfile creation project, we must first set up an environment python2.x

python official website to download, find 2.x version of the installer, here installed 2.7.17, remember that your installation directory

Then open environment variable interface, win10 own search will be able to find out

Found in the system variable Path variable , opened, and the last two lines (dependent on your installation directory)

Next detects whether the configuration: win + R, type cmd, and open a command prompt, where incidentally the recommended global search software Everything + Wox

Enter python, get the following information

The successful installation of python environment

Visual studio

Then we need an IDE, recommended here vs2019 , if vs already installed, please open your vs installer

Check the C ++ game development and installation

cocos2d-x environment

In cocos2d official website to download cocos2d-x source version, note the cocos2d-x

Unzip the downloaded file into the build folder, using the installed vs open cocos2d-win32.sln

Solution Explorer on the left, right-cpp-empty-test project, set to start entry

Click on the local Windows debugger start compiling, compiled in a notebook speed may be slower,

The first secondary compiled some static libraries may fail, we fail to compile a second time, after the completion of the translation, if helloworld window appears, demonstrate that all environmental set up is completed

After testing solutions can clean up to free up some space (less than the future of this project)

New Construction

Path decompressed cocos2d-x-3.17.2\tools\cocos2d-console\binlower (inner bin), according to a command prompt to open the right shift +

Press shift + right under the new win10 no command prompt, and we have to go through the registry plus

Create a table or somewhere in your OpenCmdHere.txtfile, enter the following code in it:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHere]
@="Open cmd here"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHere\command]
@="cmd.exe /s /k pushd "%V""

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]
@="Open cmd here"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHere]
@="Open cmd here"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHere\command]
@="cmd.exe /s /k pushd \"%V\""

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHere]
@="Open cmd here"
"Icon"="cmd.exe"

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHere\command]
@="cmd.exe /s /k pushd \"%V\""

Save and close the suffix name .txtchanged .reg, double-click operation

Then you go to cocos2d-x-3.17.2\tools\cocos2d-console\bindirectory right, cmd he came

After opening, enter cocos new PROJECT-NAME -p com.coco2dx.org -l cpp -d PROJECT-PATHthis instruction, do not rush to copy and paste , here PROJECT-NAMErefers to the name of your project, for themselves, one PROJECT-PATHthat you want to store the project directory address, cpp means we use C ++ development

For example, my input is:

cocos new Test -p com.coco2dx.org -l cpp -d D:\4prj\cocos2d-x-dev

(First use might ask whether you consent to the collection of information, it does not matter)

After waiting for the completion of input can find a copy of the new project is completed at the target path

END

Guess you like

Origin www.cnblogs.com/zhxmdefj/p/11681538.html