1

I am trying to run an OpenCV4Android in my eclipse. I am working on Linux(CentOS 6). I have done everything mentioned in this link but I am still getting build errors. I have also set the NDK path in preferences hat is not mentioned in the tutorial and tried a lot more things. When I try to build the library project the console gives:

"Cannot run program "/ndk-build": Unknown reason
 Error: Program "/ndk-build" is not found in PATH"

All the projects also have build errors and the src and gen folders in openCV4 Library is not created and the build path shows:

"Unable to get system library for the project" 

When i try to change the project properties I get an error saying the page contains invalid values and I cannot change the android api version. Plz help. Have been trying to set this up since 3 days now. Thank you.

1 Answer 1

1

First Clean and Build you library Project alone and then try cleaning all your projects. In order to solve the "Cannot run program "/ndk-build": Unknown reason Error: Program "/ndk-build" is not found in PATH" error, Try the following steps:

Head to the project's properties. If you're using Windows, the shortcut is Alt + Enter; or simply right-click the project name to find its properties.

Go to the C/C++ Build section; under Builder Settings tab in Build command: text box you're likely to find something similar to that below, if it's empty then type in the similar text - namely: ${NDKROOT}/ndk-build.cmd where NDKROOT, as its name implies, refers to the path where your NDK root folder exists.

Now you must inform eclipse what NDKROOT equates to; as in, where is the NDK root path. You can do this by heading to (in your project's properties) C/C++ Build > Environment > press Add…

Now add your environment variable named NDKROOT (the Name) with the relevant path (Value). Note that you're to repeat this per NDK project. You would get a window similar to that below.

Press OK to the New variable input window and then OK again to the properties window.

Hopefully this will help!

Sign up to request clarification or add additional context in comments.

1 Comment

hey thanks..but I am still getting an error saying "Resource '/OpenCV Library - @OPENCV_VERSION@/bin' does not exist." the console gives the following messsage "/home/Manthan/Softwares/Android/android-ndk-r8e/ndk-build clean jni/Android.mk:6: OpenCV.mk: No such file or directory Android NDK: WARNING: Unsupported source file extensions in jni/Android.mk for module opencv_java make: *** No rule to make target `OpenCV.mk'. Stop. Android NDK: /OpenCV Library "

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.