无法解析基于模板的标识符"get". Netbeans 8.1 [英] Unable to resolve template based identifier "get". Netbeans 8.1

查看:101
本文介绍了无法解析基于模板的标识符"get". Netbeans 8.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是:

我正在收到帖子主题中显示的警告. 真的很仓促. 自动完成不适用于该代码,否则会发生警告. 标准设置为 C ++ 14 .

I am receiving warning which is presented in the topic of a post. It is really flustrating. The autocomplete does not work with the code, beside which the warning occurs. The standard is set to C++14.

例如:

 Boxes[2].get()->setPosition(Boxes[2].get()->getPosition() + v1);

这会给我一个警告,当我尝试编写另一个Boxes[2].时,自动完成不起作用.

It gives me a warning and when I try to write another Boxes[2].the autocomplete does not work.

对象的声明:

<shared_ptr<ofxBox2dRect>> Boxes;

我尝试使用以下链接解决问题:

  1. 无法解析netbeans上的标识符
  2. 无法解析标识符",尽管构建成功
  1. Unable to resolve identifier on netbeans
  2. "Unable to resolve identifier" , although build is successful

还有很多,但他们并没有帮助我:(我放弃了该项目,等等.)

And much more but they did not help me: (I repearsed the project etc.)

我的NetBeans版本是8.1,C ++插件1.29.6.1在Apricity OS上运行.

我做了一些研究,并且收到了其他一些警告,我认为它们与我的问题有关.

I did some research and I receive some of other warnings as well and I think that they are related with my problem.

警告列表:

Recursive directive #include <boost/predef/os/bsd.h> 
Analyzed user include paths and user include headers: 
/usr/include 
/usr/lib 
/usr/lib64 
/usr/share 
/usr/src 
/usr/include/gstreamer-1.0 
/usr/lib/gstreamer-1.0/include 
/usr/include/AL 
/usr/include/alsa 
/usr/include/gtk-3.0 
/usr/include/at-spi2-atk/2.0 
/usr/include/at-spi-2.0 
/usr/include/dbus-1.0 
/usr/lib/dbus-1.0/include 
/usr/include/gio-unix-2.0 
/usr/include/cairo 
/usr/include/pango-1.0 
/usr/include/atk-1.0 
/usr/include/pixman-1 
/usr/include/freetype2 
/usr/include/libpng16 
/usr/include/harfbuzz 
/usr/include/glib-2.0 
/usr/lib/glib-2.0/include 
/usr/include/libdrm 
/usr/include/gdk-pixbuf-2.0 
/home/charllie/of-workspace/libs/fmodex/include 
/home/charllie/of-workspace/libs/glfw/include 
/home/charllie/of-workspace/libs/glfw/include/GLFW 
/home/charllie/of-workspace/libs/kiss/include 
/home/charllie/of-workspace/libs/poco/include 
/home/charllie/of-workspace/libs/tess2/include 
/home/charllie/of-workspace/libs/utf8cpp/include 
/home/charllie/of-workspace/libs/utf8cpp/include/utf8 
/home/charllie/of-workspace/libs/openFrameworks 
/home/charllie/of-workspace/libs/openFrameworks/graphics 
/home/charllie/of-workspace/libs/openFrameworks/math 
/home/charllie/of-workspace/libs/openFrameworks/events 
/home/charllie/of-workspace/libs/openFrameworks/gl 
/home/charllie/of-workspace/libs/openFrameworks/communication 
/home/charllie/of-workspace/libs/openFrameworks/video 
/home/charllie/of-workspace/libs/openFrameworks/3d 
/home/charllie/of-workspace/libs/openFrameworks/utils 
/home/charllie/of-workspace/libs/openFrameworks/app 
/home/charllie/of-workspace/libs/openFrameworks/sound 
/home/charllie/of-workspace/libs/openFrameworks/types 
/home/charllie/of-workspace/libs/openFrameworksCompiled/project 
Analyzed system include paths: 
/usr/include/c++/6.1.1 
/usr/include/c++/6.1.1/x86_64-pc-linux-gnu 
/usr/include/c++/6.1.1/backward 
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/include 
/usr/local/include 
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/include-fixed 
/usr/include 
/home/charllie/of-workspace 
Include path trail to current file: 
/home/charllie/of-workspace/libs/openFrameworks/graphics/ofPath.cpp: (line 1) 
/home/charllie/of-workspace/libs/openFrameworks/graphics/ofPath.h: (line 6) 
/home/charllie/of-workspace/libs/openFrameworks/graphics/ofPolyline.h: (line 5) 
/home/charllie/of-workspace/libs/openFrameworks/types/ofRectangle.h: (line 6) 
/home/charllie/of-workspace/libs/openFrameworks/utils/ofLog.h: (line 4) 
/home/charllie/of-workspace/libs/openFrameworks/utils/ofFileUtils.h: (line 8) 
/usr/include/boost/filesystem.hpp: (line 16) 
/usr/include/boost/filesystem/path.hpp: (line 29) 
/usr/include/boost/shared_ptr.hpp: (line 17) 
/usr/include/boost/smart_ptr/shared_ptr.hpp: (line 35) 
/usr/include/boost/smart_ptr/detail/spinlock_pool.hpp: (line 25) 
/usr/include/boost/smart_ptr/detail/spinlock.hpp: (line 50) 
/usr/include/boost/smart_ptr/detail/spinlock_sync.hpp: (line 18) 
/usr/include/boost/smart_ptr/detail/yield_k.hpp: (line 28) 
/usr/include/boost/predef.h: (line 17) 
/usr/include/boost/predef/os.h: (line 18) 
/usr/include/boost/predef/os/bsd.h: (line 52) 
/usr/include/boost/predef/os/bsd/bsdi.h: (line 11) 
/usr/include/boost/predef/os/bsd.h: (line 95) 
/usr/include/boost/predef/os/bsd/dragonfly.h: (line 11) 
/usr/include/boost/predef/os/bsd.h: (line 96) 
Ctrl+Alt+Click to open include hierarchy

我认为此警告最重要:

Library File /usr/include/boost/smart_ptr/shared_ptr.hpp 
but there is an recursion #include <boost/predef/os/bsd.h> in included /usr/include/boost/predef/os/bsd/free.h 
Use Ctrl+Alt to show analyzed paths Ctrl+Alt+Click to open file with failed include directive

我花了几个小时试图解决我的问题.我按照上面给出的链接中介绍的步骤进行操作,但是它们没有帮助我. 希望在那里能找到帮助.

I spent couple of hours trying to solve my problem. I followed the steps which are presented in links given above, but they did not help me. Hope that there I will find help.

对我来说最重要的是 接收完全可用的 autocomplete .

The most important thing for me is to receive the autocomplete fully workable.

我打开了自动完成 打开,它可以正常工作,但在这种情况下不行.

I got the autocomplete ON and it works fine, but not in this particular case.

我认为这可能是名称空间的问题,因此添加using namespace std; 我重建,清理和重新整理了该项目,但没有帮助.;(

I thought that might be a problem with namespaces so add using namespace std; I rebuilt, cleaned and repearsed the project, but it did not help.;(

感谢您的帮助;)

推荐答案

我遇到了同样的问题.问题在于boost predef/os/bsd.h 标头.它在#else块中#ifndef BOOST_PREDEF_OS_BSD_H防护#包含5个文件.这意味着,如果这5个文件中的任何一个还包含bsd.h(它们确实这样做),则该头文件就不会被阻止递归.

I was having the same problem. The issue is with the boost predef/os/bsd.h header. It #includes 5 files in the #else block for the #ifndef BOOST_PREDEF_OS_BSD_H guard. This means that this header file is not guarded against recursion if any of those 5 files also includes bsd.h (which they do).

我的解决方案是编辑predef/os/bsd.h文件并在#else块中添加递归保护-因此,从第94行开始,我的predef/os/bsd.h文件现在看起来像:

My solution was to edit the predef/os/bsd.h file and add a recursion guard in the #else block - so, starting at around line 94 my predef/os/bsd.h file now looks like:

#ifndef BOOST_PREDEF_OS_BSD_H_PREVENT_RECURSION      <-- ADD THIS
#define BOOST_PREDEF_OS_BSD_H_PREVENT_RECURSION      <-- ADD THIS

#include <boost/predef/os/bsd/bsdi.h>
#include <boost/predef/os/bsd/dragonfly.h>
#include <boost/predef/os/bsd/free.h>
#include <boost/predef/os/bsd/open.h>
#include <boost/predef/os/bsd/net.h>

#endif                                               <-- ADD THIS

现在,netbeans代码帮助很高兴,我的代码仍然可以链接和编译而没有错误.

And now netbeans code assistance is happy and my code still links and compiles without error.

这篇关于无法解析基于模板的标识符"get". Netbeans 8.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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