1. Installing vs2012
2. Download cocos2dx2.1.3, unzip, then install vs template
Installation method to be in CMD dos, CD to this directory, and then install.
The results are as follows:
3. Start vs New Project:
4. After the project is established:
5. Configure the environment, add header file path, Lib path
In view--property manager:
Select in Debug. Win32.user
Modify the Include directory and library directory.
Contains the directory needs to configure all the COCOS2DX header file directory, listed here, if there is missing, add it yourself:
(Replace the%cocos2dxdir% with the real path of the COCOS2DX)
Cocos2dxinclude:
%cocos2dxdir%\cocos2dx\include;
%cocos2dxdir%\external;
%cocos2dxdir%\cocos2dx\platform\win32;
%cocos2dxdir%\cocos2dx\platform\third_party\win32\pthread
%cocos2dxdir%\external\chipmunk\include\chipmunk;
%cocos2dxdir%\external\sqlite3\include;
%cocos2dxdir%\cocos2dx\kazmath\include;
%cocos2dxdir%\cocos2dx\platform;
%cocos2dxdir%\cocos2dx\platform\third_party\win32;
%cocos2dxdir%\chipmunk\include\chipmunk;
%COCOS2DXDIR%\COCOS2DX;
%cocos2dxdir%\cocosdenshion\include;
%cocos2dxdir%\cocos2dx\extensions;
%cocos2dxdir%\extensions
%cocos2dxdir%\cocos2dx\extensions\cctexturewatcher;
%cocos2dxdir%\cocos2dx\extensions\assetsmanager;
%cocos2dxdir%\cocos2dx\extensions\localstorage;
%cocos2dxdir%\cocos2dx\extensions\network;
%cocos2dxdir%\cocos2dx\extensions\physics_nodes;
%cocos2dxdir%\cocos2dx\extensions\spine;
%cocos2dxdir%\cocos2dx\extensions\gui\cccontrolextension;
%cocos2dxdir%\cocos2dx\extensions\gui\cceditbox;
%cocos2dxdir%\cocos2dx\extensions\gui\ccscrollview;
%cocos2dxdir%\cocos2dx\extensions\ccnotificationcenter;
%cocos2dxdir%\cocos2dx\extensions\cclistview;
%cocos2dxdir%\cocos2dx\extensions\cccontrolextension;
%cocos2dxdir%\cocos2dx\extensions\ccbreader;
# If you are using JNI, then add the following path
C:\Program Files\java\jdk1.8.0_20\include;
C:\Program Files\java\jdk1.8.0_20\include\win32;
C:\Program Files\java\jdk1.8.0_20\include\win32\bridge;
If you want to add lib:pthreadVCE2.lib with Pthread
If you want to use ScrollView and the like is extension category, add LibExtensions.lib
6. Download the OpenGL Development Library: Glew
https://www.opengl.org/sdk/libs/GLEW/
Installation method See: Doc/index.html
I am vs2012, installed to the e-drive, so the path is:
E:\Program Files (x86) \microsoft Visual Studio 11.0\VC\INCLUDE\GL
Glew is a cross-platform, C + + extension library based on the OpenGL graphics interface. Friends who use OpenGL know that window currently only supports OpenGL1.1, but OpenGL has now grown to more than 2.0, to use these advanced features of OpenGL, you must download the latest extensions, in addition, different graphics companies, will also publish some of the only home video card support extension functions, you want to use this count, you have to find the latest glext.h, With the Glew extension library, you'll never have to worry about finding a function interface, because Glew can automatically identify all the OpenGL advanced extensions supported by your platform. That is, you can use all the functions of GL,GLU,GLEXT,WGL,GLX as long as you include a glew.h header file. Glew supports various operating systems currently in vogue (including Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris).
Project home: http://glew.sourceforge.net/
: Https://sourceforge.net/project/downloading.php?group_id=67586&filename=glew-1.5.1-src.zip
7. Compiling:
8. Running
You need to prepare the COCOS2DX DLL file before you run it. The simplest way is to copy all of the DLL files under Cocos2d-2.1rc0-x-2.1.3\debug.win32 to C:\Windows\System32.
If it's a 64-bit system, copy it to C:\Windows\SysWOW64.
And then run it again.
---------------------------------------------finished-----------------------------------------------
To pass parameters to the application:
Error Resolution:
1. "Input error: No file extension". js "script engine. ”
Enter "regedit" in the run to enter the registration form,
Just change the default value under [Hkey_classes_root\.js] to "Jsfile" to run the JS file normally.
2. Input error: Unable to find script file "C:\Users\Administrator\template\msvc\InstallWizardForVC2010Express.js
is because the reason for directly double-clicking the bat needs to be executed in CMD:
CD/D E:\02_soft_libs\cocos2d-2.1rc0-x-2.1.3 #切换到cocos2dx的目录
Install-templates-msvc.bat #再执行安装
3. The final step of establishing a project error
Solution:
Uninstall the update.
4. When running, error:
Need to copy DLL to program run directory or system directory (System32 or SysWOW64)
001-cocos2dx-2.1.3 Environment Construction-windows