This document records the process and experience of the Cpp-tests project that has taken some time to run through Cocos2d-x 3.8.1 in recent days.
Celebrate first:
650) this.width=650; "title=" 01.JPG "alt=" wkiom1ynjnvitofkaaorrs2phz0208.jpg "src=" http://s3.51cto.com/wyfs02/M02/ 74/bc/wkiom1ynjnvitofkaaorrs2phz0208.jpg "/>
Operating Environment:
Since I recently wanted to fully upgrade the Thumb Solitaire game project to the newest cocos2d-x 3.8.1+cocos 2.3.2 environment, I wanted to debug the project cpp-tests through its accompanying example, because from this example project I could find almost all the new improvement techniques needed for the upgrade project, Don't want to get into a lot of trouble.
First, I'm on the Cocos developer Platform http://www.cocos.com/doc/article/index?type=wiki&url=/doc/cocos-docs-master/manual/ Framework/native/wiki/how-to-run-cpp-tests-on-mac-osx/zh.md
Find the article " How to run cpp-tests on Mac OSX", it feels good. Unfortunately this article is for Mac machine, in my WIN7 virtual machine environment can not directly run through.
My solution is as follows.
The first step
Reference article Http://blog.sina.com.cn/s/blog_ 3e28c8a50102vmwv.html, in my VS2013 environment debug through cpp-tests WIN32 version (and Android version, later I also record the implementation process via Android).
Of course, I did not download the Cocos2d-x project under the virtual machine Mac, but it was implemented under Windows 7. The download file is Cocos2d-x-3.8.1.zip (378,644kb) and the download page is http://www.cocos.com/download/#.
Step Two
Set up the virtual machine mac (client) with VMware to share the unpacked folder above with Windows7.
Add: After I set up the share above, a shared folder "Vmware Shared Folders" appears on the desktop of my Mac virtual machine, because a path with a space character cannot perform some related actions on the Mac command line. So I simply copy a cocos2d-x-3.8.1 directly on the desktop (strongly recommended, if you also make such a copy, do not copy the extracted folder, but instead of copying the compressed file, that is, the above cocos2d-x-3.8.1.zip, and then in the MAC internal decompression; Because the extracted folder co cos2d-x-3.8.1 size is 9G).
Then, go to the Cocos directory (my path is Desktop/cocos2d-x-3.8.1/tools/cocos2d-console/bin), create a project framework, execute the following commands (for example, modify as needed):
Cocos new cpp-tests-p com.zxz.cpp-tests-l cpp-d ~/documents
In fact, the above command can be written in the following format:
Python cocos.py new cpp-tests-p com.zxz.cpp-tests-l cpp-d ~/documents
Step Three
Open Xcode and then refer to the above article to replace the project cpp-tests under the corresponding folder for the project that you just created under the classes and resources replication.
Note: There is a difference between copying the source file and copying the resource file, details as described in article http://blog.csdn.net/fanjunxi1990/article/details/9352917, skip this.
After the copy is complete, make sure that the source file folder is blue and that the resource folder is * * *.
Fourth Step
650) this.width=650; "title=" 02.JPG "src=" http://s3.51cto.com/wyfs02/M00/74/BC/wKiom1YnmX2RkyXSAAGCSNYSM-0865.jpg "alt=" Wkiom1ynmx2rkyxsaagcsnysm-0865.jpg "/>
As shown, select the project build type and choose iOS emulation for iphone 4s (default to iphone 6), then click the Run button to start compiling, linking the process, and trying to run the project.
The first error encountered during compilation is a reference to the Curl/curl.h file, and the error indicates that the header file was not found, as shown in.
650) this.width=650; "Title=" captures 2015-10-19-night. JPG "src=" http://s3.51cto.com/wyfs02/M02/74/BC/wKiom1Ynm7SyJQDcAAJ2u1AVDIo126.jpg "alt=" Wkiom1ynm7syjqdcaaj2u1avdio126.jpg "/>
After parsing the file path, add the path of the file to the project reference path, as shown in.
650) this.width=650; "title=" 03.JPG "src=" http://s3.51cto.com/wyfs02/M00/74/B9/wKioL1YnmtLS_HC_AAIFap-MRlQ850.jpg "alt=" Wkiol1ynmtls_hc_aaifap-mrlq850.jpg "/>
Tip: Double-click/applications/cocos ..... Part, add a new search path, on my machine is applications/cocos/frameworks/cocos2d-x-3.8.1/tools/cocos2d-console/bin.
After the above modification, the project compiles through, but the link process also appears error, as shown in.
650) this.width=650; "title=" 2015-10-21.jpg "src=" http://s3.51cto.com/wyfs02/M01/74/BC/ Wkiom1ynm8ahvbgpaavuub7fx5g439.jpg "alt=" Wkiom1ynm8ahvbgpaavuub7fx5g439.jpg "/>
Fifth Step
Debugging the above errors took some time, mainly because the iOS system framework is not familiar, and the final URL to find the reference answer is http://www.cocoachina.com/bbs/read.php?tid=216075.
That is, you need to add mediaplayer.framework in the project before compiling, linking.
Thereafter, everything is OK, as shown in the beginning of the article to run the interface.
This article is from the "Green Peak" blog, please make sure to keep this source http://zhuxianzhong.blog.51cto.com/157061/1705004
Windows 7 (64bits) + virtual machine run Cocos2d-x 3.8.1 cpp-tests Project