编译错误,而试图建立OpenCV4Android [英] Build errors while trying to set up OpenCV4Android

查看:169
本文介绍了编译错误,而试图建立OpenCV4Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Eclipse运行OpenCV4Android。我的工作在Linux(CentOS的6)。
我做这个链接提到的一切,但我仍然得到生成错误。我还设置preferences帽子NDK的路径在本教程中没有提及,并尝试了很多更多的事情。当我尝试构建库项目的控制台提供:

I am trying to run an OpenCV4Android in my eclipse. I am working on Linux(CentOS 6). I have done everything mentioned in this link but I am still getting build errors. I have also set the NDK path in preferences hat is not mentioned in the tutorial and tried a lot more things. When I try to build the library project the console gives:

"Cannot run program "/ndk-build": Unknown reason
 Error: Program "/ndk-build" is not found in PATH"

所有的项目也有openCV4图书馆建设的错误和src和根文件夹不会创建和构建路径显示:

All the projects also have build errors and the src and gen folders in openCV4 Library is not created and the build path shows:

"Unable to get system library for the project" 

当我试图改变项目属性我得到一个错误说该页面包含无效值,我不能改变的Andr​​oid API版本。 plz帮助。一直试图对此进行设置,因为现在3天。
谢谢你。

When i try to change the project properties I get an error saying the page contains invalid values and I cannot change the android api version. Plz help. Have been trying to set this up since 3 days now. Thank you.

推荐答案

首先清理并单独建立你的库项目,然后尝试清洗所有的项目。为了解决无法运行程序/ NDK的构建:不明原因的错误:程序/ NDK的构建,在路径未找到错误,请尝试以下步骤:

First Clean and Build you library Project alone and then try cleaning all your projects. In order to solve the "Cannot run program "/ndk-build": Unknown reason Error: Program "/ndk-build" is not found in PATH" error, Try the following steps:

头到项目的属性。如果你使用的是Windows,快捷键是Alt + Enter键;或只需右键单击该项目名称找到它的属性。

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.

进入C / C ++编译部分;在生成命令生成器设置选项卡下:文本框,你很可能会发现类似下面的东西,如果它是空的,然后键入类似的文本 - 即:$ {} NDKROOT哪里/ndk-build.cmd NDKROOT,正如它的名字顾名思义,指的是你的NDK的根文件夹所在的路径。

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.

现在,您必须告知偏食什么NDKROOT相当于;如,哪里是NDK根路径。您可以通过标题(在你的项目的属性),C / C ++编译做到这一点>环境> preSS添加...

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…

现在添加一个名为NDKROOT(名称)的有关路径(值)的环境变量。请注意,你每NDK项目重复这一点。你会得到类似下面的一个窗口。

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确定新的变量输入窗口,然后再次单击确定。

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

希望这将有助于!

这篇关于编译错误,而试图建立OpenCV4Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆