Cocos2d-x transplant to WindowsPhone8 migration problem-libcurl Library Migration problem

Source: Internet
Author: User

In the latest version of Cocos2d-x 3.x, the header and library files needed to migrate the Windows Phone 8 Platform Libcurl Library are available. But it's not easy to successfully port the Libcurl library on the Windows Phone 8 platform, and it takes a bit of effort, and I've summed up the following steps:
Configure header File Search path
Configuring the linked environment
Add a dynamic link library


1. Configure header File Search path
We can refer to the Rapidjson library porting described in the previous section for the entire procedure. The process is to select the Hellocppcomponent Project, open the menu "project" → "properties" pop-up project Properties dialog box, select "Configuration Properties" → "C + +" → "General", on the right side of the "Additional Include directory" add $ (engineroot) external\ Curl\include\wp8.
In addition, since the project we are porting also needs to parse JSON data, we also need to configure and port the Rapidjson library.


2. Configure the link environment
Configuring the link environment process is divided into two steps: Configuring additional Library directories and configuring additional dependencies. Configuring an additional library directory is the directory where the library files that you want to link are located, and the configuration additional dependencies are the library files that you specify to link.
Let's first look at configuring the additional library directory. The process is to select the Hellocppcomponent Project, open the menu "project" → "properties" pop-up project Properties dialog box, as shown, select "Configuration Properties" → "connector" → "General", in the right "additional Include directory" add $ (engineroot) external \curl\prebuilt\wp8\$ (Platform), note that the configuration should be separated by semicolons.

Configure Additional Library Directories

Tip the $ (Platform) macro in the path that represents the files in arm or win32,arm is ready for debugging and deployment of Windows Phone 8 devices, while files in Win32 are prepared for debugging on a PC running Windows Phone 8 emulator.


Next we configure the additional dependencies. Open the Project Properties dialog box, as shown in, select "Configuration Properties" → "connector" → "input", and in the right window, "Additional Dependencies", add content libcurl.lib.

Configure Additional Dependencies


3. Add a dynamic link library
The above two-step configuration, if not configured, directly causes the program to fail compilation errors. Adding a dynamic-link library without configuration can cause run-time errors that are more subtle.
These library files are also under the $ (engineroot) external\curl\prebuilt\wp8\$ (Platform) directory, and we add them according to the platform that is running. The specific step is to select the Hellocppcomponent Project right-click menu, select "Add" → "Existing Item", Open the Add Project dialog box, as shown, find the $ (engineroot) external\curl\prebuilt\wp8\$ (Platform The actual directory, select files Libcurl.dll, Libeay32.dll and Ssleay32.dll files, select OK and click "Add" button to add.

Add Project Dialog box

Once added, we also need to set properties on these files, as shown in the File Open Properties dialog box, where content is set to true, which ensures that the files are copied to the runtime environment when they are compiled. Please set up each of these three dynamic link library files individually.

Setting file properties

If the above three steps are completed successfully, we can run the test. The migration of Libcurl Library is very representative, it belongs to the header files and library files with each platform, and there is no source file situation. We can all take this as a transplant for everything.

For more information, please pay attention to the first Cocos2d-x 3.2 Edition book "Cocos2d-x: C + + volume"

Book Exchange Discussion website: http://www.cocoagame.net
For more exciting video courses, please follow Cocos class: Http://v.51work6.com

Welcome to join Cocos2d-x Technical discussion group: 257760386

Welcome to Luxgen iOS Classroom public Platform


Cocos2d-x transplant to WindowsPhone8 migration problem-libcurl Library Migration problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.