Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV Native Samples are not building

I have spent a long while trying to get this thing to work, and I think my error is very trivial but I have been unable to fix it. Plus, I know there have been questions about this before but none have helped me solve my issue.

I am using the android-opencv library in eclipse juno

When I build the sample, I will use sample 4 as an example, I get this message in my console:

15:29:35 **** Build of configuration Default for project org.opencv.samples.tutorial4.Sample4Mixed ****
"C:\\dev\\android-ndk-re8b-windows\\ndk-build.cmd" 
Cannot run program "C:\dev\android-ndk-re8b-windows\ndk-build.cmd": Launching failed

Error: Program "C:\dev\android-ndk-re8b-windows\ndk-build.cmd" not found in PATH
PATH=[C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Broadcom\WHL\;C:\Program Files\Broadcom\WHL\syswow64;C:\Program Files\Broadcom\WHL\SysWow64\;C:\Program Files\Broadcom\WHL\SysWow64\syswow64;C:\Program Files (x86)\Common Files\Lenovo;C:\Program Files (x86)\Common Files\Ulead Systems\MPEG;C:\Program Files (x86)\Windows Live\Shared;C:\SWTOOLS\ReadyApps;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\MATLAB\R2011a Student\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Symantec\VIP Access Client\;C:\Program Files (x86)\SSH Communications Security\SSH Secure Shell]

15:29:35 Build Finished (took 54ms)

Where are the double \'s coming from?!

Also I did define my environmental variable NDKROOT to be the absolute path to my ndk. But to be even more safe, I defined it again in my properties->c/c++ build path.

HELP

like image 978
Armon-LUStudent Avatar asked Sep 17 '12 19:09

Armon-LUStudent


2 Answers

Try the following steps:

  1. Head to the project's properties. If you're using Windows, the shortcut is Alt + Enter; or simply right-click the project name to find its properties.

  2. Go to the C/C++ Build section; under Builder Settings tab in Build command: text box you're likely to find something similar to that below, if it's empty then type in the similar text - namely: ${NDKROOT}/ndk-build.cmd where NDKROOT, as its name implies, refers to the path where your NDK root folder exists. enter image description here

  3. Now you must inform eclipse what NDKROOT equates to; as in, where is the NDK root path. You can do this by heading to (in your project's properties) C/C++ Build > Environment > press Add…

  4. Now add your environment variable named NDKROOT (the Name) with the relevant path (Value). Note that you're to repeat this per NDK project. You would get a window similar to that below. enter image description here

  5. Press OK to the New variable input window and then OK again to the properties window.

like image 81
Noha Kareem Avatar answered Nov 07 '22 19:11

Noha Kareem


If you use Windows 7, you can set it like this:

  1. Right click on "My Computer"
  2. Click on "Properties"
  3. Click on "Advanced System"
  4. Make a new variable NDKROOT
  5. Change the value to your NDK path
  6. Restart Eclipse
  7. Click "OK"
like image 31
puputCantik Avatar answered Nov 07 '22 18:11

puputCantik