之前,wchar_t 是作为 unsigned short 来处理的,从vs2008开始,默认将其作为内置类型来处理。
如果想仍将其作为 unsigned short 的别名:则需要
/Zc:wchar_t-
When using QString::fromWCharArray(const wchar_t* , int size = - 1);
vs2005 gives the following error:Qt Code:- error LNK2019: unresolved external symbol "__declspec(dllimport)
- public: static class QString __cdecl QString::fromWCharArray(wchar_t const *,int)"
- (__imp_?fromWCharArray@@@SA?AV1@PB_WH@Z) referenced in function "public:
- void __thiscall midiIO::queryMidiInDevices(void)" (?queryMidiInDevices@midiIO@@QAEXXZ)
To copy to clipboard, switch view to plain text mode
To fix this, go to Project --> Properties --> Configuration Properties -->
C/C++ --> Language, and set 'Treat wchar_t as Built-in Type' to No.
Hope it helps someone, it fixed my day...原文链接