[COCOS2DX Note 004] Android add static library project

Source: Internet
Author: User

(based on 2.2.2 version)
This step is more troublesome, not as good as the vs2013 set. Many articles have been referenced. Still can't solve the problem. Only slowly groping. Posted here, hoping to make it possible for everyone to go a little detour.
It is also an example of the mylib mentioned in the previous article. [COCOS2DX Note 003] Vs2013 adding static Library engineering
first, go to External\mylib and hit Android.mk with a text editor.

and modify the part of the circle in the diagram

The results of the modification are
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)/ Includelocal_cflags: =-std=c99 include $ (build_static_library) Note: the $ (local_path) here is Android The directory where the. Mk resides.
In this way, a library project is OK, the next step is in the use of their own projects. My project is an example of Xmtank.


The part of the red circle is. Then, in the project's source file or header file, contains the header file for this static library.

Then compile and run under Cygwin.



In this way, you can compile and use your static library in Android. I don't have anything under iOS right now, and I don't have a configuration for this iOS project for the time being.

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.