Reputation: 439
I'm trying to setup ndk to work with eclipse, but getting this error message
Program "/ndk-build.cmd" is not found in PATH
Following other posts (ndk-build not found in Path , Set Build path in Eclipse for ndk program) I tried to set the NDK folder in preferences -> android -> NDK, but it did't work.
Next I tried to manually set the NDK folder in Build Path->Configure Build Path -> C/C++ Build->Builder Setting Tab -> ndk-build path for one specific project, and it worked, but I need to repeat this for all my projects one at a time.
Any idea how to set the path correctly?
Upvotes: 3
Views: 9176
Reputation: 2003
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
Then Click OK
That's It
Upvotes: 0
Reputation: 15875
I've also suffered a lot with configuring the NDK in my eclipse. At last, this procedure was working for me (with eclipse helios):
Download Eclipse NDK plugin
and NDK
and configure it by
eclipse > windows > preference > android > NDK > configure NDK location
Import a project which has native C++ codes and require NDK. After importing, it will say Program "/ndk-build.cmd" is not found in PATH
right click on the project, go to
new > other > C/C++ > convert to C/C++ > toolchains > android GCC > click finish
Right click on the project and go to project property.
Property > C++ build > Environment
Create a variable named NDK-BUILD
with your NDK location
Property > C++ build > Environment
In Builder Settings:
put Build Command: ${NDK-BUILD}/ndk-build.cmd
In behavior:
unchecked Clean
Go to Property > C/C++ general > Paths & symbols > Language > GNU C++
add a variable with path: ${NDK-BUILD}\platforms\android-9\arch-arm\usr\include
Press apply & ok
Upvotes: 4