android - OpenCV native 示例未构建

标签 android eclipse opencv android-ndk

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

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

帮助

最佳答案

尝试以下步骤:

  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. OKNew variable输入窗口,然后再次按OK到属性窗口。

关于android - OpenCV native 示例未构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12466074/

相关文章:

android - 方向更改时的 DialogFragment 回调

android - IN 子句和占位符

java - TestNG 未在 eclipse 上运行测试

java - 我无法从 Eclipse 连接到 MySql Workbench 数据库

android - 允许权限后设备无法获取位置 - React Native - Android

android - 错误 : Contains illegal final field -Kotlin

eclipse - 如何在 Eclipse 下载站点上找出哪个特性包含所需的插件

Java opencv - 错误 - java.library.path 中没有 jniopencv_core

c++ - 如何创建具有电视效果的图像?

c++ - OpenCV 垫到 SFML 图像