QT4.8 编译程序报错 error LNK2019: unresolved external symbol __imp__PlaySoundW等

报错内容

Error	3	error LNK2019: unresolved external symbol __imp__PlaySoundW@12 referenced in function "public: static void __cdecl QAccessible::updateAccessibility(class QObject *,int,enum QAccessible::Event)" (?updateAccessibility@QAccessible@@SAXPAVQObject@@HW4Event@1@@Z)	D:\rCode\qt-book\chap04\spreadsheet\QtGuid.lib(qaccessible_win.obj)	spreadsheet (chap04\spreadsheet)
Error	4	error LNK2019: unresolved external symbol _ImmSetCandidateWindow@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ)	D:\rCode\qt-book\chap04\spreadsheet\QtGuid.lib(qwininputcontext_win.obj)	spreadsheet (chap04\spreadsheet)
Error	5	error LNK2019: unresolved external symbol _ImmSetCompositionWindow@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ)	D:\rCode\qt-book\chap04\spreadsheet\QtGuid.lib(qwininputcontext_win.obj)	spreadsheet (chap04\spreadsheet)
Error	6	error LNK2019: unresolved external symbol _ImmSetCompositionFontW@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ)	D:\rCode\qt-book\chap04\spreadsheet\QtGuid.lib(qwininputcontext_win.obj)	spreadsheet (chap04\spreadsheet)
Error	7	error LNK2019: unresolved external symbol _ImmGetContext@4 referenced in function "struct HIMC__ * __cdecl getContext(struct HWND__ *)" (?getContext@@YAPAUHIMC__@@PAUHWND__@@@Z)	D:\rCode\qt-book\chap04\spreadsheet\QtGuid.lib(qwininputcontext_win.obj)	spreadsheet (chap04\spreadsheet)
Error	8	error LNK2019: unresolved external symbol _ImmReleaseContext@8 referenced in function "void __cdecl releaseContext(struct HWND__ *,struct HIMC__ *)" (?releaseContext@@YAXPAUHWND__@@PAUHIMC__@@@Z)	D:\rCode\qt-book\chap04\spreadsheet\QtGuid.lib(qwininputcontext_win.obj)	spreadsheet (chap04\spreadsheet)
Error	9	error LNK2019: unresolved external symbol _ImmNotifyIME@16 referenced in function "void __cdecl notifyIME(struct HIMC__ *,unsigned long,unsigned long,unsigned long)" (?notifyIME@@YAXPAUHIMC__@@KKK@Z)	D:\rCode\qt-book\chap04\spreadsheet\QtGuid.lib(qwininputcontext_win.obj)	spreadsheet (chap04\spreadsheet)
Error	10	error LNK2019: unresolved external symbol _ImmGetCompositionStringW@16 referenced in function "long __cdecl getCompositionString(struct HIMC__ *,unsigned long,void *,unsigned long)" (?getCompositionString@@YAJPAUHIMC__@@KPAXK@Z)	D:\rCode\qt-book\chap04\spreadsheet\QtGuid.lib(qwininputcontext_win.obj)	spreadsheet (chap04\spreadsheet)
Error	11	error LNK2019: unresolved external symbol _ImmAssociateContext@8 referenced in function "void __cdecl enableIme(class QWidget *,bool)" (?enableIme@@YAXPAVQWidget@@_N@Z)	D:\rCode\qt-book\chap04\spreadsheet\QtGuid.lib(qwininputcontext_win.obj)	spreadsheet (chap04\spreadsheet)
Error	12	error LNK2019: unresolved external symbol _ImmGetDefaultIMEWnd@4 referenced in function "struct HWND__ * __cdecl getDefaultIMEWnd(struct HWND__ *)" (?getDefaultIMEWnd@@YAPAUHWND__@@PAU1@@Z)	D:\rCode\qt-book\chap04\spreadsheet\QtGuid.lib(qwininputcontext_win.obj)	spreadsheet (chap04\spreadsheet)
Error	13	error LNK2019: unresolved external symbol _WSAAsyncSelect@16 referenced in function "public: void __thiscall QEventDispatcherWin32Private::doWsaAsyncSelect(int)" (?doWsaAsyncSelect@QEventDispatcherWin32Private@@QAEXH@Z)	D:\rCode\qt-book\chap04\spreadsheet\QtCored.lib(qeventdispatcher_win.obj)	spreadsheet (chap04\spreadsheet)
Error	14	error LNK1120: 11 unresolved externals	D:\rCode\qt-book\chap04\spreadsheet\debug\\spreadsheet.exe	spreadsheet (chap04\spreadsheet)

解决方案

在这里插入图片描述
加入lib库:Imm32.libWinmm.libws2_32.lib

参考链接

https://forum.qt.io/topic/13669/getting-unresolved-externals-with-static-version-4-8-0/3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值