简体   繁体   中英

Build errors while trying to set up OpenCV4Android

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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM