Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does the Windows 7 + virtual machine run the Cocos2d-x 3.8.1 cpp-tests project

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how the Windows 7 + virtual machine runs the Cocos2d-x 3.8.1 cpp-tests project. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

Here is a record of the process and experience of spending a lot of time running a cpp-tests project that passed Cocos2d-x 3.8.1 in recent days.

Let's celebrate in the picture above:

Operating environment:

Windows 7 64 bits

VMware Workstation 10.0.2+Mac OS X 10.9

Xcode 6.1

Cocos2d-x 3.8.1

Because I want to upgrade the thumb connection game project to the latest Cocos2d-x 3.8.1+Cocos 2.3.2 environment recently, I want to debug the accompanying example project cpp-tests first, because from this example project I can find almost all the new and improved technologies needed for the upgrade project, but I don't want to encounter a lot of trouble.

First of all, I am 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

It feels good to find the article "how to run cpp-tests on Mac OSX" at. Unfortunately, this article is aimed at Macs and can't be run directly in my WIN7 virtual machine environment.

My solution is as follows.

The first step

Refer to the article http://blog.sina.com.cn/s/blog_3e28c8a50102vmwv.html to debug the WIN32 version of cpp-tests (and the Android version) in my VS2013 environment, and I'll record the implementation through Android later.

Of course, instead of downloading the cocos2d-x project under the virtual machine MAC, I downloaded it under Windows 7. The download file is cocos2d-x-3.8.1.zip (378644KB) and the download page is http://www.cocos.com/download/#.

Step two

Set up the virtual machine MAC (client) to share the unzipped folder above with Windows7 through Vmware.

Add: after I set up the share above, a shared folder "Vmware Shared folders" appears on my MAC virtual machine desktop. Since the path with a space character cannot perform some related operations under the MAC command line, I might as well copy another cocos2d-x-3.8.1 directly on the desktop (it is highly recommended that if you do the same copy, never copy the unzipped folder. Instead, copy the compressed file, that is, the cocos2d-x-3.8.1.zip above, and then decompress it inside the MAC Because the unzipped folder cocos2d-x-3.8.1 size is 9G).

Then, go to the directory of cocos (my path is desktop/cocos2d-x-3.8.1/tools/cocos2d-console/bin), create a framework for the project, and execute the following command (for example, modify it 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, then refer to the above article, and copy the Classes and Resources under the project cpp-tests to replace the corresponding folder of the project you just created in the steps above.

Note: there is a difference between copying source files and copying resource files, details as described in the article http://blog.csdn.net/fanjunxi1990/article/details/9352917, skip here.

At the end of the copy, be sure to make sure that the corresponding folder for the source file is blue and the corresponding folder for the resource is *.

The fourth step

As shown in the figure above, select the project build type and select ios simulation as iphone 4s (default is iphone 6), then click the run button to start the compilation, link process, and try to run the project.

The first error encountered during compilation is the referencing of the curl/curl.h file, which indicates that the header file was not found, as shown in the following figure.

After analyzing the file path, add the file path to the project reference path, as shown in the following figure.

Tip: double-click / Applications/cocos. In part, add a new search path, which is Applications/cocos/frameworks/cocos2d-x-3.8.1/tools/cocos2d-console/bin on my machine.

After the above modification, the project compiles and passes, but there is an error in the linking process, as shown in the following figure.

Step five

It took a lot of time to debug the above errors, mainly because I was not familiar with the ios system framework, and finally found the reference answer URL is http://www.cocoachina.com/bbs/read.php?tid=216075.

That is, you need to add MediaPlayer.framework to the project before compiling and linking.

After that, all OK will run the interface as shown at the beginning of the article.

This is the end of the Cocos2d-x 3.8.1 cpp-tests project on how to run Windows 7 + virtual machines. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report