Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/153.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 使用Visual Studio 2005(VC8)时发生链接错误_C++_Visual Studio_Linker_Vc8 - Fatal编程技术网

C++ 使用Visual Studio 2005(VC8)时发生链接错误

C++ 使用Visual Studio 2005(VC8)时发生链接错误,c++,visual-studio,linker,vc8,C++,Visual Studio,Linker,Vc8,我在尝试链接可执行文件的发布版本时遇到了一系列链接错误(调试版本没有相同的问题)。比较链接的命令行不会发现任何问题。 大致有两种类型的错误,这两种错误我都无法处理 第一类抱怨未解析的外部符号_declspec(dllimport) 例如: 错误LNK2019:未解析的外部符号 “_declspec(dllimport) 公众:u_uthis call stlpd_std::basic_string,class stlpd_std::allocator>::basic_string,class s

我在尝试链接可执行文件的发布版本时遇到了一系列链接错误(调试版本没有相同的问题)。比较链接的命令行不会发现任何问题。 大致有两种类型的错误,这两种错误我都无法处理

第一类抱怨未解析的外部符号_declspec(dllimport) 例如: 错误LNK2019:未解析的外部符号 “_declspec(dllimport) 公众:u_uthis call stlpd_std::basic_string,class stlpd_std::allocator>::basic_string,class stlpd_std::allocator>(class stlpd_std::basic_string,class stlpd_std::allocator>const&)“(\u imp??0?$basic_string@DV?$char_traits@D@stlpd_std@@V$allocator@D@2@@stlpd\u标准@@QAE@ABV01@@Z) 在函数中引用“public:uu thiscall Springfield::generic::runtime\u error::runtime\u error(类stlpd\u std::basic\u string,类stlpd\u std::allocator>const&)”(??0运行时_error@generic@斯普林菲尔德@@QAE@ABV?$basic_string@DV?$char_traits@D@stlpd_std@@V$allocator@D@2@@@stlpd_std@@@Z)

对于更易于阅读的版本(替换所有字符串): 错误LNK2019:未解析的外部符号 “uu declspec(dllimport) 公众:u_uthis call string::basic\u string,类stlpd\u std::allocator>(类string const&)“(\u imp??0?$basic_string@DV?$char_traits@D@stlpd_std@@V$allocator@D@2@@stlpd\u标准@@QAE@ABV01@@Z) 在函数“public:u thiscall Springfield::generic::runtime_error::runtime_error(类字符串const&)”中引用(??0运行时)_error@generic@斯普林菲尔德@@QAE@ABV?$basic_string@DV?$char_traits@D@stlpd_std@@V$allocator@D@2@@@stlpd_std@@@Z

第二类错误抱怨 未解析的外部符号\uuu CrtDbgReportW


我希望在处理此问题时能获得一些见解。

从错误中可以看出,您似乎没有将CRT作为链接库之一。这里是指向Visual Studio 2005中提供的不同CRT库的链接。请选择最合适的CRT库,并确保它位于要链接的库列表中


看起来要么包含使用调试设置生成的文件,要么混合使用运行库(DLL和静态).

是否正在重建所有内容?是否链接到需要调试CRT的库中?是否使用了正确的标题?请使用/showIncludes确保。感谢您的建议,我将尝试使用它。事实证明,我在visual studio中使用了_debugpreprocessor指令。