Eclipse的编译成功,但仍给语义错误 [英] Eclipse compiles successfully but still gives semantic errors

查看:780
本文介绍了Eclipse的编译成功,但仍给语义错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注:这显然是一个计算器反复发作的问题,而是 - 为我所看到的 - 无论是人从来没有找到一种方法,或者他们的解决方案不适合我

我使用Eclipse ADT朱诺。一切工作正常,直到我试图更新NDK。我取代我的 NDK 文件夹(也就是 NDK-r8d )的新版本(即 NDK-R8E ),并在我的路径和符号配置,我改变了包括来自G ++ 4.6去4.7。

I am using Eclipse Juno ADT. Everything was working fine until I tried to update the NDK. I replaced my ndk folder (that was the ndk-r8d) by the new version (i.e. ndk-r8e) and, in my Paths and Symbols configuration, I changed the includes to go from g++ 4.6 to 4.7.

这似乎打破我的索引:我可以编译我的code,但是Eclipse正在给语义错误,酷似[<一href="http://stackoverflow.com/questions/15612673/eclipse-cdt-displays-semantic-error-but-builds-successfully">1]和[<一href="http://stackoverflow.com/questions/10103465/eclipse-cdt-complains-about-unresolved-functions-but-still-builds-successfully">2].这些错误的主要的来自符号使用OpenCV4Android,如距离 PT queryIdx trainIdx

It seemed to break my index: I could compile my code, but Eclipse was giving semantic errors, exactly like in [1] and [2]. The errors mainly come from symbol used by OpenCV4Android, such as distance, pt, queryIdx and trainIdx.

当我试图备份到我的旧配置,该指数仍打破!我无法找到一个方法来改变这种状况。

When I tried to backup to my old configuration, the index was still broken! I cannot find a way to change this.

  • 清理项目
  • 重建,更新,和所有其他的索引子菜单选项(当右击的项目)
  • 禁用/启用在preferences索引
  • 验证,如 trainIdx 符号只会出现在我的OpenCV4Android包括在路径和符号部分。
  • 更改订单我包括在路径和符号部分。我基本上是试图把OpenCV的包括在开始和结束。
  • Clean up the project
  • Rebuild, refresh, and all the other options in the "Index" submenu (when "right-clicking" on the project)
  • Disable / enable the indexer in the preferences
  • Verify that symbols such as trainIdx only appear in my OpenCV4Android include in the Paths and Symbols section.
  • Change the order of my includes in the Paths and Symbols section. I basically tried to put the OpenCV include in the beginning and in the end.

我认为它是在 CDT指数因如下:

  • 在命令行中,我可以通过建立我的项目 NDK-打造干净 NDK建造
  • 当我启动Eclipse,我没有错误,直到我打开一个C ++文件(从 JNI 文件夹)。
  • 我可以随时生成项目,但只要我打开了一个C ++文件,我不能,因为很多的现场运行应用程序了'&LT;名称&gt;无法得到解决。
  • 如果我不打开C ++文件,Eclipse不报告任何错误,可以构建并成功地部署了Android应用程序。
  • In command line, I can build my project using ndk-build clean and ndk-build.
  • When I start Eclipse, I have no error until I open a C++ file (from the jni folder).
  • I can always build the project, but as long as I have opened a C++ file, I can't run the application anymore because of a lot of Field '<name>' could not be resolved.
  • If I don't open the C++ files, Eclipse doesn't report any error and can build and deploy the Android application successfully.

下面code报告了 queryIdx PT <错误/ code>:

The following code reports errors on line, queryIdx, pt:

cv::line(mRgb, keypointsA[matches[i].queryIdx].pt, keypointsB[matches[i].trainIdx].pt, cv::Scalar(255, 0, 0, 255), 1, 8, 0);

如果我把它写如下,它的工作原理:

If I write it as follows, it works:

cv::DMatch tmpMatch = matches[i];
cv::KeyPoint queryKp = keypointsA[tmpMatch.queryIdx];
cv::KeyPoint trainKp = keypointsB[tmpMatch.trainIdx];
cv::line(mRgb, queryKp.pt, trainKp.pt, cv::Scalar(255, 0, 0, 255), 1, 8, 0);

这并不是说所有的OpenCV的功能没有得到解决:仅 PT queryIdx trainIdx

任何意见将非常AP preciated。

Any comment will be really appreciated.

推荐答案

在您选定的项目$ P $在Eclipse环境中pferences,转到C / C ++通用 - > code分析 - >下水。确保两个复选框都没有选中。

In your selected project preferences within the Eclipse environment, go to C/C++ General -> Code Analysis -> Launching. Make sure that both check boxes are unchecked.

这篇关于Eclipse的编译成功,但仍给语义错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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