使用Eclipse编译C ++文件时错误在Android中NDK项目 [英] Errors when building C++ files in Android NDK project using Eclipse

查看:139
本文介绍了使用Eclipse编译C ++文件时错误在Android中NDK项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直有钩住了Android NDK到Eclipse IDE中工作的一些实际问题。

具体来说,我一直在尝试使用NDK与OpenCV的工作,因此我已经下载了OpenCV的样品,其中包括一个项目,不上镜头框架面部识别。

这个项目,一段时间后,我设法得到充分在Eclipse中工作。 NDK的建筑工程一样,Eclipse中的索引器。当我更改了C ++ code的东西,它建立正确吧...一切正常。

然而,然后是我的问题:我要创造我自己的项目。要做到这一点,我决定这是一个好主意,首先是对面此示例项目复制为基地,并从那里更改。有一次,我已经复制这个项目,但是,生成错误出现 - JNI的C ++文件显示错误的负载,当我做出改变,他们不建(所以我不认为这只是一个索引的问题)。

有谁知道,不会被转移设置时,我将项目以这种方式?我已经尝试了所有的比较我已经玩到这一点,试图把它打造的设定。

我希望这个问题不是太含糊。让我知道如果有任何更多的信息,我可以添加,使其更清晰。

在OpenCV的样品配OpenCV4Android,也可以在这里下载: http://opencv.org/downloads.html

在此先感谢!
克里斯


解决方案

转到 项目属性 - > C / C ++编译 - >工具链编辑器 ,设置当前工具链 Android的GCC 当前的建设者 Android的生成器
那么选择工具和替换编译器的 GCC C ++编译器

那么你应该设置路径到你的头文件。

结果

I have been having some real problems hooking up the Android NDK to work within the Eclipse IDE.

Specifically, I have been trying to use the NDK to work with OpenCV, and as such I have downloaded the OpenCV samples, which include a project that does facial recognition on camera frames.

This project, after some time, I have managed to get fully working in Eclipse. The NDK building works, as does the indexer within eclipse. When I change something in the C++ code, it builds it correctly... everything works.

However, then comes my problem: I want to create my own project. To do this I decided it was a good idea firstly to just copy across this sample project as a base, and change it from there. Once I have copied this project, however, the build errors appear - the jni C++ files show loads of errors, and when I make changes they do not build (so I don't think this is just an indexing issue).

Does anyone know of settings that would not be transferred when I copy the project in this way? I have tried comparing all of the settings I have been playing with up to this point to try and get it to build.

I hope this question is not too vague. Let me know if there is any more info I could add, to make it more clear.

The OpenCV samples come with OpenCV4Android, that can be downloaded here: http://opencv.org/downloads.html

Thanks in advance! Chris

解决方案

Go to Project properties -> C/C++ Build -> Tool Chain Editor, set Current toolchain to Android GCC and current builder to Android Builder then select tools and replace compiler with GCC C++ Compiler.

Then you should set Paths to your header files.


这篇关于使用Eclipse编译C ++文件时错误在Android中NDK项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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