简体   繁体   中英

Error: Program “/NDK-build” not found in PATH

I need help. I'm trying to install and configure OpenCV 2.4.7 library in my computer (Ubuntu 12.04). After run OpenCV samples appears those errors in my Console:

Cannot run program "/NDK-build" : Unknown reason

Error: Program "/NDK-build" not found in PATH= [/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games]

I've seen numerous tutorials and nothing worked. I ask you to be very specific since I am "new" programming and also because my mother tongue is not English (I have some difficulties). Thank you!

Easiest Method which worked for me is.

Goto the Project Properties
Click on C/C++ Build (An other list will open)
Click on the Environment from the list
Now click on Add

Here you have to Put 2 values
Put Name as NDKROOT
In Value put PATH TO THE NDK FOLDER

在此输入图像描述

You are done :)

Same case happened with me (when my NDK location was already set), so changing to original Android Builder removed my problem for doing so simply go to project properties, C/C++ Build | Tool Chain Editor and select Android Builder as current builder.

Do you have android-ndk installed? If yes, add path to ndk-build to your path. eg:

export PATH=$PATH:~/android-ndk/bin

this is a frequent issue with openCV for Android. It stems from having the incorrect build target, which creates an error within the library for the Video.java file. After getting that patched up, you can import sample projects. Although, after fixing that, you may not be able to see the C/C++ Build node under project preferences. There's a fix for that on the second link. However, if under project preferences you can see C/C++ Build, make sure the path reads: " ${NDKROOT}/ndk-build " Finally, it will be looking for NDKROOT,which is undeclared. The third link will direct you on how to do this, it's very simple. ALSO, make sure if your on MAC or LINUX to remove the .cmd from the end of NDK-BUILD. Good Luck!

Video.java issue:
    http://answers.opencv.org/question/8266/opencv-library-244-on-eclipse-gives-error/ 
C++ Build/General Missing from Project Preferences:
    http://stackoverflow.com/questions/16953548/eclipse-missing-c-c-build-and-general-from-project-properties
Now, make sure you add NDK root to the build varialbles so you can find it:
    http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Ftasks%2Fcdt_t_add_build_var.htm`

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