Case three: Compile dynamic library + static Library

Source: Internet
Author: User

Http://www.cnblogs.com/yaozhongxiao/archive/2012/07/10.html

Case three: Compile dynamic library + static Library

File android.mk:

Local_path: = $ (call My-dir)

Include $ (clear_vars)
Local_module: = mylib_static
Local_src_files: = src.c
Include $ (build_static_library)

Include $ (clear_vars)
Local_module: = mylib_shared
Local_src_files: = src2.c

Local_static_libraries: = mylib_static

Include $ (build_shared_library)

Situation four: There is a third-party static library (dynamic Library), the compilation of static library (dynamic library)

File android.mk:

Local_path: = $ (call My-dir)

Include $ (clear_vars)
Local_module: = thirdlib1 # name it whatever
Local_src_files: = $ (Target_arch_abi)/libthird1.a # or $ (so_path)/libthird1.so
#LOCAL_EXPORT_C_INCLUDES: = $ (Local_path)/include
Include $ (prebuilt_static_library) #or prebuilt_shared_library

Include $ (clear_vars)
Local_module: = Mylib_use_thirdlib
Local_src_files: = src.c

Local_static_libraries: = Thirdlib1 #or local_shared_library

Include $ (build_shared_library) #如果编译静态库, requires application.mk

Using a Third-party dynamic library, a static library needs to be precompiled (Build_shared_library or Prebuilt_static_library)

and local_static_libraries local_shared_library to igz add a dynamic library or a static library

If the system library (static library/dynamic library) is used, it can be implemented as follows: local_ldlibs: =-lm-llog-ljnigraphics-lz



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.