Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 490
user2336917 Avatar asked Nov 25 '13 18:11

user2336917


People also ask

What is NDK build?

The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.

What is NDK path?

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.

How do you use NDK?

To use Android NDK support in your application, you need to download the following three tools: LLDB: It is used by Android Studio to debug the native code present in your project. NDK: Native Development Kit(NDK) is used to code in C and C++ i.e. native languages for Android.


2 Answers

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

enter image description here

You are done :)

like image 104
farhangdon Avatar answered Oct 14 '22 04:10

farhangdon


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.

like image 20
Engr Muhammad Zohaib Avatar answered Oct 14 '22 04:10

Engr Muhammad Zohaib