2010-06-07 158 views
5

我想看看您是否可以定位我。在Visual Studio 2010中增強IntelliSense錯誤

碰巧我編譯和爲了與Visual Studio 2010中使用它們引用的Boost庫在構建我的測試項目中,我得到這兩個智能感知錯誤

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定義,似乎在config.hpp由boost_regex,我包括以下

哪個代碼定義
#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錯誤;然而,我不明白爲什麼這些智能感知錯誤首先出現,第二,爲什麼將宏指向config.hpp定義爲BOOST_LIB_NAME

任何指導將不勝感激。

感謝,

海梅

回答

5

對於C Visual Studio的智能感知錯誤檢查++是不完美的,經常報告的錯誤,aren'treallyerrors(這些都是鏈接到我發現和報告了三個誤報;儘管他們與你的問題沒有關係)。