本地C ++与Android基于Eclipse - 在STDLIB但作品给人错误 [英] Native c++ with Android on Eclipse - gives error on stdlib but works

查看:102
本文介绍了本地C ++与Android基于Eclipse - 在STDLIB但作品给人错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在建设我的Andr​​oid应用程序在Android Eclipse环境。建立我的C ++ code和NDK建造independantly编译它。这工作正常。

I have been building my android app in an android eclipse environment. Building my c++ code and compiling it independantly with ndk-build. That works fine.

我需要调试是由logcat的抛出,一下子一个SIGSEGV错误。

I need to debug a sigsegv error which is thrown by logcat all of a sudden.

于是我打开该项目在Eclipse中添加本地code的机器人。现在我调试C ++ code,但每次我使用任何性病组件,如矢量的,所以我不能运行code,因为它包含了错误的时间给我一个错误。

So I switched the project in eclipse to 'add native code in android'. Now it debugs my c++ code, but gives me an error each time I use any of the std components, such as vector and so I cannot run the code since it contains errors.

该项目运行良好的previous配置。我加了一个lib性病的支持,我相信。

The project ran fine on the previous config. I added a lib for std support I believe.

我如何能正确地调试我的家乡code你知道吗?

Any idea on how I can properly debug my native code?

感谢您的帮助

更新 我完全重新安装了SDK,日食(JUNO这段时间),所有plugings。不用找了。该错误检查无法识别的Java和性病相关的东西:

UPDATE I totally reinstalled my sdk, eclipse (juno this time) and all plugings. No change. The error checking does not recognise java and std related stuff:

#include <jni.h>
using namespace std;

有红色下划线。

is underlined in red.

C ++的其余部分被正确识别。

The rest of c++ is recognised properly.

UPDATE2

当我添加$ {NDKROOT} /来源/ CXX-STL / GNU-的libstdc ++ /包括为路径,并包括已经包含在Java语句。净矢量然而,我也尝试添加$ {NDKROOT} /来源/ CXX-STL / STLport的/ STLport的,但它并没有解决向量问题呢。如果错误检查是残疾人,项目编译,如果我做一个synthax错误,编译器警告我。这是确定的我。

When I add ${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include to Paths and Includes, The java statements are already included. Net the vectors yet, I also tried to add ${NDKROOT}/sources/cxx-stl/stlport/stlport but it did not fix the vector problem yet. If error checking is disabled, the project compiles and if I make a synthax error, the compiler warns me. That is ok for me.

推荐答案

您,也许,可以,首先,禁用错误的项目属性| C / C ++一般| $ C C分析$ 让你的项目编译。

You, probably, can, first, disable errors in Project Properties|C/C++ General|Code Analysis so your project compiles.

然后,您可以检查包括路径项目属性| C / C ++一般|路径和符号是正确的。

You can then check if the include paths in Project Properties|C/C++ General|Paths and Symbols are correct.

我还听说,更新ADT插件可能会有所帮助。

I have also heard that updating the ADT plugin may help.

这篇关于本地C ++与Android基于Eclipse - 在STDLIB但作品给人错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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