简体   繁体   中英

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

用于C ++的Visual Studio IntelliSense错误检查并不完美,并且经常报告不是 真正 错误的错误 (这些错误是我发现并报告的三个误报的链接;不过,它们与您的问题无关)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM