0
votes

I'm using OpenCV for Android. The default example mentioned on the OpenCV website does not run. console says... { 22:16:40 ** Auto Build of configuration Default for project OpenCV Sample - face-detection ** "\ndk-build.cmd" Cannot run program "\ndk-build.cmd" (in directory "C:\Users\Parth Sane\workspace\OpenCV Sample - face-detection"): CreateProcess error=2, The system cannot find the file specified

Error: Program "\ndk-build.cmd" not found in PATH PATH=[C:/Program Files/Java/jdk1.7.0_07/bin/../jre/bin/server;C:/Program Files/Java/jdk1.7.0_07/bin/../jre/bin;C:/Program Files/Java/jdk1.7.0_07/bin/../jre/lib/amd64;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files\Java\jdk1.7.0_07\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;D:\WinSCP\;C:\Program Files (x86)\FAHClient;C:\Users\Parth Sane\Desktop\eclipse;]

22:16:40 Build Finished (took 410ms) }

The Mixed processing example gives similar a similar error...

Help!! Other samples run well...

1
Add ndk-build.cmd to your path.Kai
can you pls specify exactly where? Thanks!Boggartfly
Somewhere in: C:/Program Files/Java/jdk1.7.0_07/bin/../jre/bin/server;C:/Program Files/Java/jdk1.7.0_07/bin/../jre/bin;C:/Program Files/Java/jdk1.7.0_07/bin/../jre/lib/amd64;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files\Java\jdk1.7.0_07\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;D:\WinSCP\;C:\Program Files (x86)\FAHClient;C:\Users\Parth Sane\Desktop\eclipse; (Have you read the error message?)Kai
lol the path is right... I got it with other samples but no sucess with this one....Boggartfly
maybe the sample is broken then?Kai

1 Answers

1
votes

Go to your OpenCV Sample face detection project in Eclipse, go to Project Properties, and then open "C/C++ Build" tab on the left-hand-side list. There you'll see a default builder configuration. It will be pointing to:

${NDKROOT}/ndk-build.cmd 

You have to either change this entry right there to point to where your ndk-build script is, or define NDKROOT environmental variable pointing to the root of your Android NDK install.