今天装了vs2010, 写了一个test,调用了以前用vs2005写的一个调试用的日志类,链接死活过不了,又是库冲突 ,又是无法解析外部符号。用错误内容及vs2005与vs2010搜了半天都没找到解决办法。后来找到说是string在旧版编译器中编译的结果在新版本里有区别,于是把库拿到vs2010重新编译,再拿到项目中,终于是通过了。
贴出错误:
1> AMobileDeviceListener.cpp
1>c:\program files\microsoft visual studio 10.0\vc\include\boost\format\alt_sstream_impl.hpp : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (__imp_??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ),该符号在函数 __unwindfunclet$??0DebugLogFun@tongbu@@AAE@XZ$0 中被引用
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::basic_ofstream<char,struct std::char_traits<char> >(char const *,int,int)" (__imp_??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z),该符号在函数 "private: __thiscall tongbu::DebugLogFun::DebugLogFun(void)" (??0DebugLogFun@tongbu@@AAE@XZ) 中被引用
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::close(void)" (__imp_?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ),该符号在函数 "private: virtual __thiscall tongbu::DebugLogFun::~DebugLogFun(void)" (??1DebugLogFun@tongbu@@EAE@XZ) 中被引用
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __thiscall std::ios_base::width(int)" (__imp_?width@ios_base@std@@QAEHH@Z),该符号在函数 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) 中被引用
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" (__imp_?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z),该符号在函数 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) 中被引用
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static bool __cdecl std::char_traits<char>::eq_int_type(int const &,int const &)" (__imp_?eq_int_type@?$char_traits@D@std@@SA_NABH0@Z),该符号在函数 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) 中被引用
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static int __cdecl std::char_traits<char>::eof(void)" (__imp_?eof@?$char_traits@D@std@@SAHXZ),该符号在函数 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) 中被引用
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __thiscall std::ios_base::width(void)const " (__imp_?width@ios_base@std@@QBEHXZ),该符号在函数 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) 中被引用
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (__imp_?length@?$char_traits@D@std@@SAIPBD@Z),该符号在函数 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) 中被引用
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ),该符号在函数 "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Sentry_base::_Sentry_base(class std::basic_ostream<char,struct std::char_traits<char> > &)" (??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z) 中被引用
1>DebugLogLib.lib(DebugLogFuc.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (__imp_?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ),该符号在函数 "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Sentry_base::~_Sentry_base(void)" (??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ) 中被引用
1>E:\downloadCode\ios安装器相关\iphonedisksolution\Debug\Test.exe : fatal error LNK1120: 11 个无法解析的外部命令