eclipse OpenCV 本机示例未构建
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12466074/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
OpenCV Native Samples are not building
提问by Armon-LUStudent
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
我在 eclipse juno 中使用 android-opencv 库
When I build the sample, I will use sample 4 as an example, I get this message in my console:
当我构建示例时,我将使用示例 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 Server0\Tools\Binn\;c:\Program Files\Microsoft SQL Server0\Tools\Binn\;c:\Program Files\Microsoft SQL Server0\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.
此外,我确实将环境变量 NDKROOT 定义为 ndk 的绝对路径。但为了更安全,我在我的 properties->c/c++ 构建路径中再次定义了它。
HELP
帮助
回答by Noha Kareem
Try the following steps:
尝试以下步骤:
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.Go to the
C/C++ Build
section; underBuilder Settings
tab inBuild 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
whereNDKROOT
, as its name implies, refers to the path where your NDK root folder exists.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
> pressAdd…
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.Press
OK
to the New variableinput window and thenOK
again to the properties window.
前往项目的属性。如果您使用的是 Windows,则快捷方式是
Alt + Enter
; 或者只需右键单击项目名称以查找其属性。转到该
C/C++ Build
部分;Builder Settings
在Build command:
文本框中的选项卡下,您可能会找到与下面类似的内容,如果它为空,则输入类似的文本 - 即:${NDKROOT}/ndk-build.cmd
whereNDKROOT
,顾名思义,指的是您的 NDK 根文件夹所在的路径。现在你必须告诉 eclipse 什么
NDKROOT
等同于;例如,NDK 根路径在哪里。您可以通过前往(在您的项目的属性中)C/C++ Build
>Environment
> 按Add…
现在
Name
使用相关路径 (Value
)添加名为 NDKROOT (the ) 的环境变量。请注意,您将在每个 NDK 项目中重复此操作。你会得到一个类似于下面的窗口。按
OK
到新变量输入窗口,然后再按OK
到属性窗口。
回答by puputCantik
If you use Windows 7, you can set it like this:
如果你使用 Windows 7,你可以这样设置:
- Right click on "My Computer"
- Click on "Properties"
- Click on "Advanced System"
- Make a new variable
NDKROOT
- Change the value to your NDK path
- Restart Eclipse
- Click "OK"
- 右键单击“我的电脑”
- 点击“属性”
- 点击“高级系统”
- 创建一个新变量
NDKROOT
- 将值更改为您的 NDK 路径
- 重启 Eclipse
- 点击“确定”