我试图升级旧VC6解决VS2010。一切都很好(经过几次代码更改以处理一些VC++更改),但它拒绝链接。我有6个静态库 - 全部设置为“在共享DLL中使用MFC”和“不使用ATL” - Unicode字符集,以及一个应用程序(.EXE)设置为“使用标准Windows库”和“不使用ATL “(当然也是Unicode)。此解决方案使用Visual Studio 2005(SP1)编译/链接正常,但在VS2008和VS2010上链接失败。错误消息主要与“CStringT”有关。从我研究过的所有东西中,我也应该在VS2005中看到这些CStringT链接错误(也就是当CString改为模板类时),但正如我所说的,它在VS2005中很好地链接。我已经尝试过每一个技巧&已经在这里和其他地方推荐过的技巧(即在我的stdafx.h头文件中明确导入CStringT的模板类),但没有运气。任何人有任何新的想法?我将粘贴下面的错误样本以供参考。谢谢!LNK2001和VS2008(或VS2010)期间LNK2019错误升级从VS2005
error LNK2001: unresolved external symbol "public: class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > const & __thiscall SomeExceptionClass::GetErrorMessage(void)const " ([email protected]@@[email protected][email protected][email protected][email protected]@@@@@[email protected]@XZ)
error LNK2001: unresolved external symbol "public: class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > const & __thiscall SomeExceptionClass::GetErrorMessage(void)const " ([email protected]@@[email protected][email protected][email protected][email protected]@@@@@[email protected]@XZ)
error LNK2019: unresolved external symbol "public: class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > const & __thiscall SomeExceptionClass::GetErrorMessage(void)const " ([email protected]@@[email protected][email protected][email protected][email protected]@@@@@[email protected]@XZ) referenced in function [email protected]@@[email protected]$0
error LNK2001: unresolved external symbol "public: class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > const & __thiscall SomeExceptionClass::GetErrorMessage(void)const " ([email protected]@@[email protected][email protected][email protected][email protected]@@@@@[email protected]@XZ)
error LNK2001: unresolved external symbol "public: class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > const & __thiscall SomeExceptionClass::GetErrorMessage(void)const " ([email protected]@@[email protected][email protected][email protected][email protected]@@@@@[email protected]@XZ)
error LNK2001: unresolved external symbol "public: class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > const & __thiscall SomeExceptionClass::GetErrorMessage(void)const " ([email protected]@@[email protected][email protected][email protected][email protected]@@@@@[email protected]@XZ)
error LNK2001: unresolved external symbol "public: void __thiscall SomeDatabaseClass::ExecDirect(class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > const &)" ([email protected]@@[email protected][email protected][email protected][email protected]@@@@@[email protected]@@Z)
error LNK2001: unresolved external symbol "public: void __thiscall SomeDatabaseClass::ExecDirect(class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > const &)" ([email protected]@@[email protected][email protected][email protected][email protected]@@@@@[email protected]@@Z)
可能有一些做的“视wchar_t的内置型”选项,看到C++ - >语言选项 – stijn