带有armadillo的Eclipse CDT项目-CDT无法识别'arma'名称空间 [英] Eclipse CDT project with armadillo - CDT does not recognize 'arma' namespace

查看:110
本文介绍了带有armadillo的Eclipse CDT项目-CDT无法识别'arma'名称空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在CentOS 6.5 x64操作系统上运行,并已使用yum安装了犰狳.我正在Eclipse CDT中进行开发

I'm running on a CentOS 6.5 x64 OS and have used yum to install armadillo. I'm developing in Eclipse CDT

我已将armadillo标头包含在项目属性>> C/C ++构建>>设置>> GCC C ++编译器>>包含>>包含文件中.条目是:"/usr/include/armadillo"

I've included the armadillo header in the project properties >> C/C++ Build >> Settings >> GCC C++ Compiler >> Includes >> Include files. The entry is: "/usr/include/armadillo"

我正在处理的头文件可以识别犰狳,并且include语句没有标记任何错误或警告.

The header file I am working on recognizes armadillo and the include statement isn't flagged for any errors or warnings.

下面是代码:

#include <armadillo>

using namespace std;
using namespace arma; // arma is not recognized as a symbol

const double DEGREES_PER_RADIAN = 180.0 / datum::pi; // datum is not recognized

我已经检查了文件/usr/include/armadillo,它确实包含名称空间arma部分.

I've checked the file /usr/include/armadillo and it does include the namespace arma section.

//! \namespace arma namespace for Armadillo classes and functions
namespace arma
{

// preliminaries
...

我还检查了权限,所有用户都可以读取/usr/include/armadillo文件.

I've also checked the permissions and the /usr/include/armadillo file is readable to all users.

问题是当我添加"using namespace arma"时,CDT将该错误标记为错误并说"Symbol'arma'无法解决".

The problem is when I add the "using namespace arma", CDT marks it as an error and says that "Symbol 'arma' could not be resolved".

在这一点上,我没有其他想法可以弄清楚为什么无法识别名称空间.任何了解这一点的见解或指针将不胜感激.

At this point, I don't have any other ideas to figure out why the namespace isn't recognized. Any insights or pointers to figure this out would be much appreciated.

推荐答案

此问题的答案为我的问题提供了答案: 清除Eclipse索引,它与代码不同步

This question's answer provided the answer to my issue: Clean Eclipse Index, it is out of sync with code

链接问题中乔什·凯利的答案:

Josh Kelley's answer from the linked issue:

右键单击您的项目,进入索引"子菜单,然后选择重建". 使用修改过的文件更新"或刷新所有文件".

Right-click on your project, go under the Index submenu, and choose either "Rebuild," "Update with modified files," or "Freshen all files."

我不知道这三个选项之间的区别,而是使用修改后的文件更新"之一.或刷新所有文件"通常会为我修复.

I don't know the difference between those three options, but one of "Update with modified files" or "Freshen all files" usually fixes it for me.

此外,我确定您已经完成了此操作,但是请确保您正在运行最新版本的Eclipse CDT.当前版本的索引似乎比以前的版本可靠得多.

Also, I'm sure you've already done this, but make sure that you're running the latest version of the Eclipse CDT. Current versions seem to have much more reliable indexing than previous versions.

运行索引>>之后重建索引并>>重新整理所有文件,错误消失了.

After running Index >> Rebuild and Index >> Freshen All Files, the errors were gone.

这篇关于带有armadillo的Eclipse CDT项目-CDT无法识别'arma'名称空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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