我想看看你能否给我指路。
我碰巧编译并引用了 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
.
任何指导将不胜感激。
Thanks,
Jaime
Visual Studio IntelliSense 对 C++ 的错误检查并不完美,经常报告以下错误:aren't https://connect.microsoft.com/VisualStudio/feedback/details/540222/ really https://connect.microsoft.com/VisualStudio/feedback/details/539800/ errors https://connect.microsoft.com/VisualStudio/feedback/details/539793/(这些是我发现并报告的三个误报的链接;不过,它们与您的问题无关)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)