Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost in Visual Studio 2010, IntelliSense error

I would like to see if you could orient me.

It happens that I compiled and referenced the boost libraries in order to use them with Visual Studio 2010. When building my test project I get these two IntelliSense errors

1   IntelliSense: #error directive: "Macro BOOST_LIB_NAME not set (internal error)" c:\boost_1_43_0\boost\config\auto_link.hpp

2   IntelliSense: #error directive: "some required macros where not defined (internal logic error)."    c:\boost_1_43_0\boost\config\auto_link.hpp

Checking the auto_link.hpp header file the first error is in this line

#ifndef BOOST_LIB_NAME
#  error "Macro BOOST_LIB_NAME not set (internal error)"
#endif

Tracing the definition of BOOST_LIB_NAME, it seems that is defined in config.hpp by boost_regex, which code I am including below

#if !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE) && !defined(BOOST_ALL_NO_LIB) && defined(__cplusplus)
#  define BOOST_LIB_NAME boost_regex
#  if defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
#     define BOOST_DYN_LINK
... more code

and strangely when I point to BOOST_LIB_NAME it defines BOOST_LIB_NAME and the IntelliSense errors disappear.

My program builds and executes fine using the Boost:Regex library -- with or without the Intellisense errors; however, I do not understand why these IntelliSense errors appear in the first place, and second why pointing the macro in the config.hpp defines BOOST_LIB_NAME.

Any guidance will be greatly appreciated.

Thanks,

Jaime

like image 352
Peretz Avatar asked Jun 07 '10 17:06

Peretz


People also ask

How do I get rid of intellisense error?

Right click on the error list pane. Hi lenyox, You can disable the intellisence Error Reporting in VS2010 from Tools -> Option -> Text Editor -> C/C++ -> Advanced -> IntelliSence -> Disable Error Reporting.

What is intellisense error in Visual Studio?

Intellisense Errors are just wrong. It's acting like classes don't exist that are definitely there, and the project builds fine. It makes it impossible to use visual studio. The only solution is to delete the SUO file under the solution's '. vs/{project name}/v15' folder.

What is build Intellisense?

Intellisense is a separate compiler that works in the IDE for squiggles and code analysis.


1 Answers

The Visual Studio IntelliSense error checking for C++ is not perfect and often reports errors that aren't really errors (those are links to three false positives that I've found and reported; they aren't related to your problem, though).

like image 55
James McNellis Avatar answered Sep 21 '22 13:09

James McNellis