2010-09-24 79 views
2

我在嘗試鏈接可執行文件的發行版本(調試版本沒有相同問題)時出現一堆鏈接錯誤。比較鏈接的命令行不會顯示任何問題。有廣泛的2種類型的錯誤,我都無法處理。使用Visual Studio 2005(VC8)時鏈接錯誤

第一種抱怨一個解析外部符號_ declspec(dllimport的) 作爲一個例子: 錯誤LNK2019:解析外部符號 「 _declspec(dllimport的) 公共:__thiscall stlpd_std :: basic_string的,類stlpd_std :: allocator> :: basic_string,class stlpd_std :: allocator>(class stlpd_std :: basic_string,class stlpd_std :: allocator> const &)「(_ imp ?? 0?$ basic_string @ DV?$ char_traits @ D @ stlpd_std @@ V $ $ allocator @ D @ 2 @@ stlpd_std @@ QAE @ ABV01 @@ Z)在函數「public:__thiscall Springfield :: generic :: runtime_error :: runtime_error(class stlpd_std :: basic_string,c lass stlpd_std :: allocator> const &)「(?? 0runtime_error @ generic @Springfield @@ QAE @ ABV?$ basic_string @ DV?$ char_traits @ D @ stlpd_std @@ V?$ allocator @ D @ 2 @@ stlpd_std @@ @Z)

一個更人類可讀的版本(更換所有的字符串): 錯誤LNK2019:解析外部符號 「__declspec(dllimport的) 公共:__thiscall 串:: basic_string的,類stlpd_std ::分配器>( class string const &)「(_ imp ?? 0?$ basic_string @ DV?$ char_traits @ D @ stlpd_std @@ V?$ allocator @ D @ 2 @@ stlpd_std @@ QAE @ ABV01 @@ Z)函數「public:__thiscall Springfield :: generic :: runtime_error :: runtime_error(class string const &)」( 0runtime_error @ generic @Springfield @@ QAE @ ABV $ base_string @ DV $ char_traits @ D @ stlpd_std @@ V $ $ allocator @ D @ 2 @@ stlpd_std @@@ Z

錯誤的類型抱怨 無法解析的外部符號__CrtDbgReportW

我希望我能在處理這件事時獲得某種洞察力。

+0

一切正在重建?你在需要調試CRT的庫中鏈接嗎?你使用正確的標題?使用/ showIncludes來確認。 – 2010-09-24 00:20:39

回答

2

從錯誤它看起來像你不包括CRT作爲你的鏈接庫之一。下面是在Visual Studio 2005提供給不同的CRT lib中的鏈接選擇其中一個是最合適的,並確保它在LIB的列表中,以便對

+0

感謝您的建議將嘗試它。 – Pradyot 2010-09-24 00:38:18

+0

事實證明,我在Visual Studio中有_DEBUG預處理器指令。 – Pradyot 2010-09-24 02:21:42

1

它看起來像鏈接您要麼包含使用調試設置構建的文件,要麼包含混合運行時庫(DLL和靜態)。

+0

非常感謝,非常感謝。 – Pradyot 2010-09-24 02:22:24