I see the error as shown in the screenshot when I try to build the NDK OpenCV Android program. I have added the lines:
NDK_HOME=C:\android-ndk-rd8 export NDK_HOME
to my .bashrc file in cygwin. I am working on Windows 7 and my NDK is at C:\android-ndk-rd8
I thought adding the above lines would fix it, but it didn't work. How do I get the program to compile? Do I have to change the PATH variable? If so, how exactly do I do that?
Open your Android Studio Preference (or "File->Settings") > Appearance & Behavior > System Settings > Android SDK. You can find the path to your SDK and NDK, which is in the same directory.
You'll need to point to your NDK in your eclipse by adding the path of ndk-build to Window > preferences > android > NDK. Right click on your project folder. Choose android tools -> add native support (the bottom one) and click finish.
To compile and debug native code for your app, you need the following components: The Android Native Development Kit (NDK): a set of tools that allows you to use C and C++ code with Android. CMake: an external build tool that works alongside Gradle to build your native library.
From your error log I suppose you should specify SA environment variable, you can do it in eclipse properties for your project:
Project properties -> C/C++ Build -> Enviroment -> Here press button Add.. -> and put Name: SA with Value: path to your NDK folder
I think, from Eclipse environmental variables are referred something like {env:NDK_HOME}
. In Properties|C++|Build or something like that
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With