Import-module considerations and configuration of the Ndk_module_path

Source: Internet
Author: User

Http://www.cnblogs.com/liulipeng/p/3524345.html

Ext.: http://blog.sina.com.cn/s/blog_4057ab62010197z8.html

More specific statements refer to other correct android.mkfeatures of the Import-moduleImport the. mk file for the external module, as in the include basic. The conceptual difference is that the include import is written by ourselves. Mk. The Import-module import is the external library, the external module provides. Mk. Usage: The path to include is the absolute path to the. mk file. The import is the set path specified to the module's. Mk directory, which is relative toNdk_module_pathThe relative path to the list of paths in.Use of Import-module$ (call Import-module, relative path)-----------------the scene to reproduce---------------------------such as my current module to invoke the Cocosdenshion module.1\ Find the module name and pathLocate the android.mk location of the Cocosdenshion module. F:\COCOS2D-X\COCOSDENSHION\ANDROID\ANDROID.MK Open See: Local_module: = Cocosdenshion_shared...include $ (build_static_ LIBRARY) then the Cocosdenshion module in my own android.mk reference it is supposed to call it cocosdenshion_shared. And he's a static library.2\ referencing modules in Android.mkJust like a header file in normal code. The last line of ANDROID.MK calls $ (call import-module,cocosdenshion/android) to import the module. Note: My ndk_module_path=/cygdrive/f/cocos2d-x is already set up. If the referenced module also has import-module, his relative path is added to the Ndk_module_path. If it hadn't been added. Then local_whole_static_libraries + = cocos_jpeg_static Declare I this module to reference the static library module. ------------------------------------------------------- attention to the use of Import-module1. When setting the path, note theNdk_module_pathThe paths in each mate. 1, import the module. MK If there are import-module, note that the relative path is also in Ndk_module_path. 2, the above said Import-module and include. If the import-module and include contain the same. MK, the errors that are included are reported repeatedly.configuration of the Ndk_module_path the role of Ndk_module_pathNdk_module_path is an important variable that is used when using the $ (call import-module,xxx) function in android.mk to introduce an external library file to indicate where to look for the file. If the Ndk_module_path is not set or is not set correctly. Compile time is error is sure your Ndk_module_path variable is properly defined.settings and formats for Ndk_module_pathNdk_module_path is an environment variable, not a variable set in ANDROID.MK. Ndk_module_path multiple paths are separated by colons. Not a semicolon! And there must be no spaces in the middle of the string. An incorrect format will also error the errors above.ways to set up Ndk_module_path1.Add this environment variable manually in the system environment,2.Use the Export command to define the environment variable Ndk_module_path before running Ndk-build in build_native.sh. Example: Export ndk_module_path= Path 1: Path 2: Path 33.Add ndk_module_path= Path 1: path 2 directly to the parameters of the Ndk-build command.    The ndk-build parameters are eventually passed directly to make. Example: $NDK _root_local/ndk-build-c $HELLOWORLD _root ndk_module_path= Path 1: Path 2 (Command make aaa=213// Set AAA as an environment variable before compiling makefile to 213.)4.You can also set Ndk_module_path in Android.mk to join before the import statement, $ (call import-add-path,$ (Local_path)/platform/third_party/android /prebuilt) Adds a new path to the Ndk_module_path variable.Ndk_module_path's attention.FeelNdk_module_pathIn the path of those, I must always be clear. The path as far as possible in the module of a common root directory, do not be too messy, lest use up chaos.

Import-module considerations and configuration of the Ndk_module_path

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.