2012-09-17 38 views
15

我花了很長時間試圖讓這個東西工作,我認爲我的錯誤是非常微不足道的,但我一直無法修復它。另外,我知道之前一直存在問題,但沒有人幫助我解決問題。OpenCV本地樣本不是正在構建

我正在使用的Eclipse JUNO的Android的OpenCV庫

當我建立了樣品,我會用樣品4爲例,我在我的控制檯得到這個消息:

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) 

在哪裏是雙重來源?!

另外我確定了我的環境變量NDKROOT是我的ndk的絕對路徑。但爲了更安全,我在我的properties-> c/C++構建路徑中再次定義了它。

HELP

+0

我可以知道你的系統的NDK的路徑,因爲在文件夾 –

回答

37

嘗試以下步驟:

  1. 團長項目的屬性。如果您使用Windows,則快捷方式爲Alt + Enter;或者只需右鍵單擊項目名稱以查找其屬性。

  2. 轉到C/C++ Build部分;在Build command:文本框中的Builder Settings選項卡下,您可能會發現類似於下面的內容,如果它爲空,則鍵入類似文本 - 即:${NDKROOT}/ndk-build.cmd其中NDKROOT,顧名思義,是指NDK根文件夾存在的路徑。 enter image description here

  3. 現在您必須通知eclipse什麼NDKROOT等同於;如在,NDK根路徑在哪裏。您可以前往(在項目屬性)做到這一點C/C++ Build>Environment>按Add…

  4. 現在添加您的環境變量命名NDKROOT(該Name)的有關路徑(Value)。請注意,您要根據NDK項目重複此操作。你會得到一個類似於下面的窗口。 enter image description here

  5. OK新變量輸入窗口,然後OK再次屬性窗口。

+0

我按照你所有的指令,但仍顯示出錯誤的空間NDK得到的問題。 –

8

如果您使用的是Windows 7,你可以將其設置是這樣的:

  1. 右擊 「我的電腦
  2. 點擊的 「屬性
  3. 點擊「高級系統
  4. 製作一個新的變量NDKROOT
  5. 值更改爲您的NDK路徑
  6. 重啓Eclipse
  7. 點擊 「OK