Android NDK compilation problems

Source: Internet
Author: User

The NDK compiles C ++ and prompts that the header file cannot be found.

Error: fstream: No such file or directory
Error: set: No such file or directory
Error: string: No such file or directory
Solution:
In the directory, create the Application. mk file and add APP_STL: = gnustl_static.
STL-related errors
1. Exception-related errors
Error: exception handling disabled, use-fexceptions to enable.
2 Some STL functions cannot be found
Undefined reference to '_ cxa_end_cleanup'

Undefined reference to '_ cxa_begin_catch'
Undefined reference to '_ cxa_end_catch'
Undefined reference to '_ cxa_get_exception_ptr'

See here: http://blog.csdn.net/andyhuabing/article/details/8591459

Dynamic library compilation is normal include $ (BUILD_SHARED_LIBRARY), change to static library, do not compile include $ (BUILD_STATIC_LIBRARY)
This is because the Application. mk file is missing.
Solution: add an Application. mk file under the <project> \ jni \ directory, which contains a line of code:
APP_MODULES: = libexample
Note: The libexample name must be the same as the LOCAL_MODULE = example name in Android. mk.

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.