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

QT 专栏收录该内容
10 篇文章 0 订阅

报错内容

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

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 深蓝海洋 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值