xuilib这个vc2010下编译提示链接错误输入

丁华茗 发布于 2012/11/30 09:36
阅读 1K+
收藏 1

【华为云1024程序员节·向云而生】预约直播 抽14件华为电子产品礼包!>>>

XUi.lib(StringHelper.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " ( __imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ),该符号在函数 __catch$?_Insert_n@?$vector@V?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT @D @ATL @@ @ATL @@ @ATL @@V?$allocator@V?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT @D @ATL @@ @ATL @@ @ATL @@@std@@@std@@IAEXV?$_Vector_const_iterator@V?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT @D @ATL @@ @ATL @@ @ATL @@V?$allocator@V?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT @D @ATL @@ @ATL @@ @ATL @@@std@@@2@IABV?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT @D @ATL @@ @ATL @@ @ATL @@@Z$0 中被引用
1>XUi.lib(StringHelper.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" ( __imp_??1?$basic_string@DU?$char_traits @D @std@@V?$allocator @D @2@@std@@QAE @XZ ),该符号在函数 "protected: static void __cdecl std::vector<class ATL::CStringT<char,class ATL::StrTraitATL<char,class ATL::ChTraitsCRT<char> > >,class std::allocator<class ATL::CStringT<char,class ATL::StrTraitATL<char,class ATL::ChTraitsCRT<char> > > > >::_Xlen(void)" ( ?_Xlen@?$vector@V?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT @D @ATL @@ @ATL @@ @ATL @@V?$allocator@V?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT @D @ATL @@ @ATL @@ @ATL @@@std@@@std@@KAXXZ) 中被引用
1>XUi.lib(StringHelper.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" ( __imp_??0?$basic_string@DU?$char_traits @D @std@@V?$allocator @D @2@@std@@QAE@PBD @Z ),该符号在函数 "protected: static void __cdecl std::vector<class ATL::CStringT<char,class ATL::StrTraitATL<char,class ATL::ChTraitsCRT<char> > >,class std::allocator<class ATL::CStringT<char,class ATL::StrTraitATL<char,class ATL::ChTraitsCRT<char> > > > >::_Xlen(void)" ( ?_Xlen@?$vector@V?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT @D @ATL @@ @ATL @@ @ATL @@V?$allocator@V?$CStringT@DV?$StrTraitATL@DV?$ChTraitsCRT @D @ATL @@ @ATL @@ @ATL @@@std@@@std@@KAXXZ) 中被引用
1>XUi.lib(StringHelper.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( __imp_??0?$basic_string@DU?$char_traits @D @std@@V?$allocator @D @2@@std@@QAE@ABV01@ @Z ),该符号在函数 "public: __thiscall std::logic_error::logic_error(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( ??0logic_error@std@@QAE@ABV?$basic_string@DU?$char_traits @D @std@@V?$allocator @D @2@ @1 @ @Z ) 中被引用
1>XUi.lib(StringHelper.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " ( __imp_?c_str@?$basic_string@DU?$char_traits @D @std@@V?$allocator @D @2@@std@@QBEPBDXZ),该符号在函数 "public: virtual char const * __thiscall std::logic_error::what(void)const " ( ?what@logic_error@std@@UBEPBDXZ) 中被引用
1>C:\Documents and Settings\Administrator\桌面\XUI_v1.6_beta\XUI\Debug\TestUi.exe : fatal error LNK1120: 5 个无法解析的外部命令

 

加载中
0
丁华茗
丁华茗

添加SplitStringA定义即可:

 

 namespace StringHelper
 {
  BOOL SplitStringA(LPCSTR pszStr, LPCSTR pSeperator, std::vector<CStringA> *pRst)
  {
   char* pstr = const_cast<char*>(pszStr);
   char* r= strstr(pstr, pSeperator);
   int dlen = strlen(pSeperator);
   while( r != NULL )
   {
    if(r>pstr)
    {
     pRst->push_back(CStringA(pstr,r-pstr));
    }

    pstr = r + dlen;
    r = strstr(pstr, pSeperator);
   }
 
   return !pRst->empty();

  }
 }

0
焦晓冬
焦晓冬

Thanks for your review.

We never tried building it with VS2010. Instead, all our work is done with VS2008, as you see. 

I guess there is something incompatible between ATL of VS2010 and VS2008, with which we built XLibS.lib. 

Try to rebuild it and if you still run into the same problem, please contact me. I'll provide the source code of XLibS.lib, with which you can build it with VS2010.

Leo

milestone.jxd@gmail.com

0
Lioner
Lioner
该有的源代码是没有的  别用了~~  可能是我没找到  XLib 没有代码 啥都别说
0
焦晓冬
焦晓冬

引用来自“民华关民华”的答案

该有的源代码是没有的  别用了~~  可能是我没找到  XLib 没有代码 啥都别说

Thanks for your review. 

XLib is only a util lib and it's not worth paying any attention. We omit the source code to make building more convenient and easier.  In fact, currently XLib and XLibs only does unzip and string code convert.  

Feel free to contact me if you are curious about XLib, which does only trivial work.

0
Lioner
Lioner

引用来自“焦晓冬”的答案

引用来自“民华关民华”的答案

该有的源代码是没有的  别用了~~  可能是我没找到  XLib 没有代码 啥都别说

Thanks for your review. 

XLib is only a util lib and it's not worth paying any attention. We omit the source code to make building more convenient and easier.  In fact, currently XLib and XLibs only does unzip and string code convert.  

Feel free to contact me if you are curious about XLib, which does only trivial work.

Thank you for your reply

The best able to provide  XLib source code

 

0
焦晓冬
焦晓冬

引用来自“Lioner”的答案

引用来自“焦晓冬”的答案

引用来自“民华关民华”的答案

该有的源代码是没有的  别用了~~  可能是我没找到  XLib 没有代码 啥都别说

Thanks for your review. 

XLib is only a util lib and it's not worth paying any attention. We omit the source code to make building more convenient and easier.  In fact, currently XLib and XLibs only does unzip and string code convert.  

Feel free to contact me if you are curious about XLib, which does only trivial work.

Thank you for your reply

The best able to provide  XLib source code

 

Thanks for your review.

The source code of XLib has been uploaded with the name XLibCode.zip.

Hope for your review.

Leo. 

0
Lioner
Lioner

引用来自“焦晓冬”的答案

引用来自“Lioner”的答案

引用来自“焦晓冬”的答案

引用来自“民华关民华”的答案

该有的源代码是没有的  别用了~~  可能是我没找到  XLib 没有代码 啥都别说

Thanks for your review. 

XLib is only a util lib and it's not worth paying any attention. We omit the source code to make building more convenient and easier.  In fact, currently XLib and XLibs only does unzip and string code convert.  

Feel free to contact me if you are curious about XLib, which does only trivial work.

Thank you for your reply

The best able to provide  XLib source code

 

Thanks for your review.

The source code of XLib has been uploaded with the name XLibCode.zip.

Hope for your review.

Leo. 

Thanks very much

0
焦晓冬
焦晓冬

引用来自“Lioner”的答案

引用来自“焦晓冬”的答案

引用来自“Lioner”的答案

引用来自“焦晓冬”的答案

引用来自“民华关民华”的答案

该有的源代码是没有的  别用了~~  可能是我没找到  XLib 没有代码 啥都别说

Thanks for your review. 

XLib is only a util lib and it's not worth paying any attention. We omit the source code to make building more convenient and easier.  In fact, currently XLib and XLibs only does unzip and string code convert.  

Feel free to contact me if you are curious about XLib, which does only trivial work.

Thank you for your reply

The best able to provide  XLib source code

 

Thanks for your review.

The source code of XLib has been uploaded with the name XLibCode.zip.

Hope for your review.

Leo. 

Thanks very much

Thanks for your previous reviews. 

This problem is due to the difference between VS2008-ATL and VS2010-ATL. Because we are using ATL, VS2008 libraries will never be compatible when linked to what uses VS2010-ATL-headers. 

So, we now provide both VS2008 and VS2010 versions on our website.

Hoping the information above is useful for you.

Leo. 
0
焦晓冬
焦晓冬

引用来自“丁华茗”的答案

添加SplitStringA定义即可:

 

 namespace StringHelper
 {
  BOOL SplitStringA(LPCSTR pszStr, LPCSTR pSeperator, std::vector<CStringA> *pRst)
  {
   char* pstr = const_cast<char*>(pszStr);
   char* r= strstr(pstr, pSeperator);
   int dlen = strlen(pSeperator);
   while( r != NULL )
   {
    if(r>pstr)
    {
     pRst->push_back(CStringA(pstr,r-pstr));
    }

    pstr = r + dlen;
    r = strstr(pstr, pSeperator);
   }
 
   return !pRst->empty();

  }
 }

Thanks for your previous reviews. 

This problem is due to the difference between VS2008-ATL and VS2010-ATL. Because we are using ATL, VS2008 libraries will never be compatible when linked to what uses VS2010-ATL-headers. 

So, we now provide both VS2008 and VS2010 versions on our website.

Hoping the information above is useful for you.

Leo. 
返回顶部
顶部