使用Visual Studio 2005(VC8)时链接错误
我在尝试链接可执行文件的发行版本(调试版本没有相同问题)时出现一堆链接错误。比较链接的命令行不会显示任何问题。有广泛的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
我希望我能在处理这件事时获得某种洞察力。
从错误它看起来像你不包括CRT作为你的链接库之一。下面是在Visual Studio 2005提供给不同的CRT lib中的链接选择其中一个是最合适的,并确保它在LIB的列表中,以便对
一切正在重建?你在需要调试CRT的库中链接吗?你使用正确的标题?使用/ showIncludes来确认。 – 2010-09-24 00:20:39