Building OpenCV 2.4.5 in android ADT: “ndk-build” not found in PATH

I'm trying to follow this OpenCV document to import OpenCV sample projects into the android ADT, and am getting the now infamous "Program "C:\android\android-ndk-r8d-windows\ndk-build" not found in PATH" error. My OS is Windows 7 and I use cygwin for any Linux-like commands.

Please note: I already downloaded the NDK package, and already set the value of NDKROOT to be my NDK root folder. I setup NDKROOT both as a system-wide environmental variable, and as an ADT's C/C++ Build environment variable, as shown below:

In my NDK root folder, I made identical copies of the file "ndk-build.cmd", and renamed them as "ndk-build" and "" respectively. I chmod+x to all three ndk-build* files.

Now what happens is really puzzling: If I specify the C/C++ Build command to be ${NDKROOT}/ndk-build or ${NDKROOT}/, I get the error "Program "C:\android\android-ndk-r8d-windows\ndk-build" not found in PATH". However, if I specify it to be ${NDKROOT}/ndk-build.cmd, ADT apparently finds it, but tries to run it as a Windows command, not as a bash script, as shown below:

The only way I can build a project, is to open a cygwin terminal, cd to the sample project folder, and run the script (either ndk-build or, like this:

I googled around for a solution. Although there are lots of "ndk-build.cmd not found in PATH" questions, I have not seen a case like mine. What is happening? I might also post my question to the openCV forum.


Apparently, the command that your Eclipse tries to run (when using the ${NDKROOT}/ndk-build.cmd version) is C:\\android\\android-ndk-r8d-windows\\ndk-build.cmd, which is apparently correct.

The problem is that your ndk-build.cmd is not a windows command file. And it should be. I just downloaded the Windows version of the ndk-r8e and the ndk-build.cmd file is copied here.

Try to download the ndk again or to modify your cmd file.

Need Your Help

Google Analytics V3 API doesn't execute request in ASP MVC request analytics

I want to implement Google Analytics API v3 in ASP MVC project. Because I never did that, I made a sample console application in which I've learned how to use this API and this is the code:

salesforce - overriding a standard object detail page

override salesforce visualforce detail

I have overriden lead object standard detail page with my vf page using tag and added my own stuff(like jquery popup)...will there be any problems like security,permissions,layout modifications be...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.