#ifdef GLOBE_20150806
#define GLOBE_EXPIMP __declspec(dllexport)
#else
#define GLOBE_EXPIMP __declspec(dllimport)
#endif


 GLOBE_EXPIMP extern  std::string  WideCharToMultiChar(std::wstring str);//宽字符转多字符




banlv error LNK2019: 无法解析的外部符号 "__declspec(dllimport) class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl WideCharToMultiChar(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >)" (__imp_?WideCharToMultiChar@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z) ,该符号...
查看lib导出的函数:
__imp_?WideCharToMultiChar@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z
差别在于:
导入方:basic_string@G   也就是basic_string<unsigned short>
导出房:basic_string@_W  也就是basic_string<wchar_t>  。此处的wchar_t是内置类型。
所以wchar_t统一成内置类型或统一成非内置类型。

VS2002(VC7)的配置方法:“配置属性->C++->语言” 的“将wchar_t配置成内置类型

posted on   闻缺陷则喜何志丹  阅读(3)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
历史上的今天:
2021-06-15 天下武功彼此克制,武学之道玄之又玄



点击右上角即可分享
微信分享提示