无法解析的外部符号 “__declspec(dllimport) public: static class QString __cdecl QString::fromWCharArray(wchar_

vs2010报错:

error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class QString __cdecl QString::fromWCharArray(wchar_t const *,int)" (__imp_?fromWCharArray@QString@@SA?AV1@PB_WH@Z),该符号在函数 "private: void __thiscall CCollectClientInfo::GetSystemName(class QString &)" (?GetSystemName@CCollectClientInfo@@AAEXAAVQString@@@Z) 中被引用

原因:

msvc2008

之前,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:

    1. 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 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...

参考:http://blog.chinaunix.net/uid-22315114-id-340145

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值