[英]Boost in Visual Studio 2010, IntelliSense error
我想看看你能不能定向我。
碰巧我编译并引用了boost库,以便在Visual Studio 2010中使用它们。在构建测试项目时,出现了这两个IntelliSense错误
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
检查auto_link.hpp头文件,第一个错误在此行
#ifndef BOOST_LIB_NAME
# error "Macro BOOST_LIB_NAME not set (internal error)"
#endif
跟踪BOOST_LIB_NAME
的定义,似乎是boost_regex在config.hpp中定义的,我在下面包含了这些代码
#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
奇怪的是,当我指向BOOST_LIB_NAME
它定义了BOOST_LIB_NAME
,并且IntelliSense错误消失了。
我的程序使用Boost:Regex库构建并执行良好-有或没有Intellisense错误; 但是,我不明白为什么这些IntelliSense错误首先出现,其次为什么指向config.hpp中的宏定义BOOST_LIB_NAME
。
任何指导将不胜感激。
谢谢,
海梅
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.