Non-CygWin mode for Android compiling environment using OpenCV (Win7 + Eclipse + ADT + CDT + NDK)

Source: Internet
Author: User

 

There are only three simple steps. The official website is very concise, comprehensive, and admired.

Preparation]

1. Eclipse (Indigo)

2. ADT:This is nothing more than adding an android installation source to eclipse. If NDK Plugin is selected here, CDT will be automatically installed;

3. NDKAndroid-ndk-r9d-windows-x86_64)

Address: http://developer.android.com/tools/sdk/ndk/index.html#Installing select your desired version;

Below are a few simple configurations:

 

[Configuration A] After NDK and CDT are installed, You can see similar pages in project properties,

Once and for all, you can add the NDKROOT path to the NDK path you decompress in the system environment variable,

 

Configure B and add the header file for compiling c/c ++]

At this time, the compilation will prompt std unresolved or something. Add the header file containing path. You can check apply to all configuration;

 

Open Project Properties-> C/C ++ General-> Paths and Symbols and add the followingIncludePathsC ++:

# for NDK r8 and prior:${NDKROOT}/platforms/android-9/arch-arm/usr/include${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include${NDKROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include${ProjDirPath}/../../sdk/native/jni/include
# for NDK r8b and later:${NDKROOT}/platforms/android-9/arch-arm/usr/include${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include${ProjDirPath}/../../sdk/native/jni/include   

 

Test]

In this way, the sample of the import OpenCV-2.4.6-android-sdk comes in for testing, note that if you selectCopyTo workspace (it is best not to copy, because many codes in the sample use the sdk and take relative paths ), you need to add the include path to the sdk's jni/include path, that is, the relative path in the green background above, because your removal has no effect.

 

So now, there is no shortage of apk, and no three steps are required;
EnjoyIT,

 

 

[Non-Editor ]:

 

 

Http://developer.android.com/tools/sdk/ndk/index.html#Installing not only has a variety of ndk versions, the use of ndk in this address is also concise.

For example, there are two methods to use NativeCode: 1 ). the well-known JNI. The disadvantage of this method is that different libraries need to be compiled for different platforms (. so), such as common arm-eabi, armv7, and arm-eabi-withNeon versions; 2 ). nativeActivity is similar to the Java activity lifecycle callback function in the Android mechanism.

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.