0

My Netbeans intellisense has suddenly stopped working and it is due to the Boost predef/os/bsd.h header having a recursive include issue, as detailed here:

Unable to resolve template based identifier "get". Netbeans 8.1

where the answer says:

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).

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

Is there a way to resolve this without modifying and re-compiling the boost source code?

user997112
  • 29,025
  • 43
  • 182
  • 361
  • Possible duplicate of [Unable to resolve template based identifier "get". Netbeans 8.1](https://stackoverflow.com/questions/37236721/unable-to-resolve-template-based-identifier-get-netbeans-8-1) – Alan Birtles Sep 08 '18 at 16:34
  • 1
    File a bug with netbeans, nothing wrong with the boost headers. I've moved to visual studio code, its more reliable – Alan Birtles Sep 08 '18 at 16:51
  • @AlanBirtles Visual Studio is better for debugging (the reaction speed when hovering over variables whilst debugging is nice) but Netbeans seems more intuitive for navigating the code, generating call graphs etc. – user997112 Sep 08 '18 at 16:57
  • @AlanBirtles So the boost header does not require that guard? – user997112 Sep 08 '18 at 16:58
  • 2
    No, each of the headers that are included have their own guards, its a little strange for the file level guard to not protect the whole file (and I'm not sure its intentional) but perfectly valid. – Alan Birtles Sep 08 '18 at 17:03
  • 2
    I've raised a bug with boost, I'm pretty sure the file isn't as intended – Alan Birtles Sep 08 '18 at 17:17
  • @Alan - You might consider citing the bug here and on the potential duplicate (if the link is handy). – jww Sep 09 '18 at 00:47
  • https://github.com/boostorg/predef/issues/85 – Alan Birtles Sep 09 '18 at 08:28
  • For anybody having this same issue with Netbeans, I have no idea how but Netbeans finally resolves itself automatically about 30 mins or so later – user997112 Sep 10 '18 at 10:26

0 Answers0