#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> >)" ([email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) ,该符号...
查看lib导出的函数:
[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected][email protected]@@[email protected][email protected]@@[email protected]@Z
差别在于:
导入方:[email protected] 也就是basic_string<unsigned short>
导出房:[email protected]_W 也就是basic_string<wchar_t> 。此处的wchar_t是内置类型。
所以wchar_t统一成内置类型或统一成非内置类型。
VS2002(VC7)的配置方法:“配置属性->C++->语言” 的“将wchar_t配置成内置类型
版权声明:本文为博主原创文章,未经博主允许不得转载。