I use Qt 5.0.2 msvc verion, downloaded from qt-project. After installation, I create a new qt console application, and write the following code:
#include <QtCore/QString>
int main(int argc, char *argv[])
{
QString s;
s.toUtf8();
s.toStdWString();
return 0;
}
when I compile it , I received the following link error:
error LNK2019: undefined reference "__declspec(dllimport) public: class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __thiscall QString::toStdWString(void)const " (__imp_?toStdWString@QString@@QBE?AV?$basic_string @GU?$char_traits@G@std@@V?$allocator@G@2@@std@@XZ)
Where am I wrong? Thanks for any help!
Bookmarks