[Cocos2dx note 004] added a static library project for android

Source: Internet
Author: User

(Based on version 2.2.2)
This step is not as easy as vs2013. I have referenced many articles. Still cannot solve the problem. It's only time to explore. I will post it here, hoping that we can avoid detours.
This is also the example of mylib mentioned in the previous article. [Cocos2dx note 003] Vs2013 adds a static library project
First, go to external \ mylib and use a text editor to open Android. mk.

And modify the part of the circle in the graph.

The Modification result is as follows:
LOCAL_PATH: = $ (call my-dir) include $ (CLEAR_VARS) LOCAL_MODULE: = mylib_staticLOCAL_MODULE_FILENAME: = libmylibLOCAL_SRC_FILES: = \ src/mylibtest. cpp LOCAL_EXPORT_C_INCLUDES :=$ (LOCAL_PATH)/includeLOCAL_C_INCLUDES :=$ (LOCAL_PATH)/inclu:=-std = c99 include $ (BUILD_STATIC_LIBRARY) Note: $ (LOCAL_PATH) Here is Android. the directory where mk is located.
In this way, a database project is OK, and the next step is to use it in your own project. My project is an xmtank example.


In the red circle. Then, include the header file of the static library in the source file or header file of the project.

Then compile and run it in cygwin.



In this way, you can compile and use your static library in android. I haven't done anything under iOS yet, and I haven't configured this iOS project yet.

Related Article

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.