【问题标题】:OpenCV Native Samples are not buildingOpenCV 本机示例未构建
【发布时间】:2012-09-10 01:43:05
【问题描述】:

我花了很长时间试图让这个东西工作,我认为我的错误非常微不足道,但我无法修复它。另外,我知道之前有人对此提出过问题,但没有人能帮助我解决我的问题。

我在 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++ build path 中再次定义了它。

帮助

【问题讨论】:

  • 我可以知道您系统中的 ndk 路径,因为 ndk 遇到文件夹空间问题

标签: android eclipse opencv android-ndk


【解决方案1】:

尝试以下步骤:

  1. 前往项目的属性。如果您使用的是 Windows,则快捷方式为 Alt + Enter;或者只需右键单击项目名称以查找其属性。

  2. 转到C/C++ Build 部分;在Build command: 文本框中的Builder Settings 选项卡下,您可能会找到类似于下面的内容,如果它为空,则输入类似的文本 - 即:${NDKROOT}/ndk-build.cmd 其中NDKROOT,顾名思义,指的是NDK 根文件夹所在的路径。

  3. 现在您必须告知 eclipse NDKROOT 的含义;如,NDK 根路径在哪里。您可以通过前往(在您的项目属性中)C/C++ Build > Environment > 按 Add…

  4. 来执行此操作
  5. 现在添加名为 NDKROOT (Name) 的环境变量和相关路径 (Value)。请注意,您将在每个 NDK 项目中重复此操作。你会得到一个类似于下面的窗口。

  6. OK 进入新变量 输入窗口,然后再次按OK 进入属性窗口。

【讨论】:

  • 我已按照您的所有说明进行操作,但仍然显示错误。
【解决方案2】:

如果你使用的是 Windows 7,你可以这样设置:

  1. 右键单击“我的电脑
  2. 点击“属性
  3. 点击“高级系统
  4. 创建一个新变量NDKROOT
  5. 将值更改为您的 NDK 路径
  6. 重启 Eclipse
  7. 点击“确定

【讨论】:

    猜你喜欢
    • 2013-12-16
    • 1970-01-01
    • 2014-06-26
    • 2014-03-19
    • 2018-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多