Daxos
13th May 2010, 21:39
Hi,
i have a problem. I would convert a QString in a wstring. I think that this can be a solution:
QString test = "TEST";
wstring converted;
converted = test.toStdWString();
But when compile my code i have this error:
error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __thiscall QString::toStdWString(void)const " (__imp_?toStdWString@QString@@QBE?AV?$basic_string @_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@ XZ) referenced in function "public: void __thiscall dbInterface::save(class QString)"(save@dbInterface@@QAEXVQString@@@Z)
I think that the problem can be that i have setting the project proprieties "C/C++ Language Treat wchar_t as Built-in Type: YES".
I have try to change this value at No (/Zc:wchar_t-) and the code compile correctly. Unfortunately for may project this setting must be "YES".
How i can convert this QString in a wstring?
Can anyone help me? Thanks, Bye
i have a problem. I would convert a QString in a wstring. I think that this can be a solution:
QString test = "TEST";
wstring converted;
converted = test.toStdWString();
But when compile my code i have this error:
error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __thiscall QString::toStdWString(void)const " (__imp_?toStdWString@QString@@QBE?AV?$basic_string @_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@ XZ) referenced in function "public: void __thiscall dbInterface::save(class QString)"(save@dbInterface@@QAEXVQString@@@Z)
I think that the problem can be that i have setting the project proprieties "C/C++ Language Treat wchar_t as Built-in Type: YES".
I have try to change this value at No (/Zc:wchar_t-) and the code compile correctly. Unfortunately for may project this setting must be "YES".
How i can convert this QString in a wstring?
Can anyone help me? Thanks, Bye