c++ - Conversion of std::wstring to QString throws linker error -


hi need convert std::wstring qstring , tried obvious way of

std::wstring widestring; qstring qtstring = qstring::fromstdwstring(widestring); 

i got error:

error 2 error lnk2019: unresolved external symbol "__declspec(dllimport) public: static class qstring __cdecl qstring::fromstdwstring(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (__imp_?fromstdwstring@qstring@@sa?av1@abv?$basic_string@_wu?$char_traits@_w@std@@v?$allocator@_w@2@@std@@@z)

referenced in function "public: void __thiscall filehandler::deletedir(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >&,int,unsigned int,bool,bool)" (?deletedir@filehandler@@qaexaav?$basic_string@_wu?$char_traits@_w@std@@v?$allocator@_w@2@@std@@hi_n1@z) filehandler.obj

error 3 fatal error lnk1120: 1 unresolved externals c:\users\documents\visual studio 2008\projects\product_dev\deletefiles\debug\filehandler.exe

i tried using method qstring::fromwchararray:

qstring temp = qstring::fromwchararray(const_cast<wchar_t*>(widestring.c_str()),widestring.size()); 

the error

error 2 error lnk2019: unresolved external symbol "__declspec(dllimport) public: static class qstring __cdecl qstring::fromwchararray(wchar_t const*,int)" (__imp_?fromwchararray@qstring@@sa?av1@pb_wh@z)

referenced in function "public: void __thiscall filehandler::deletedir(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >&,int,unsigned int,bool,bool)" (?deletedir@filehandler@@qaexaav?$basic_string@_wu?$char_traits@_w@std@@v?$allocator@_w@2@@std@@hi_n1@z) filehandler.obj

error 3 fatal error lnk1120: 1 unresolved externals c:\users\documents\visual studio 2008\projects\product_dev\deletefiles\debug\filehandler.exe 1

how proceed resolve issue?

edit visual studio project settings , under c/c++ -> language set option treat wchar_t built-in type no.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -