0

I am using Qt6.2.2 in Win10 with VS2019 to build a project that involves using MsgWaitForMultipleObjects function from Windows API:

#include <windows.h>

// major codes omitted

hFrameEvent = camera.GetFrameEvent(); 

Here camera is an instance of C1394Camera for image collection.

dwRet = MsgWaitForMultipleObjects(1,&hFrameEvent,FALSE,timeout,QS_ALLINPUT); //MsgWaitForMultipleObjects is called 

Building the project gives the error LNK2019 error unresolved external symbol __imp_MsgWaitForMultipleObjects referenced in function "public: void __cdecl ...

Does the error mean that the MsgWaitForMultipleObjects is not properly used or something wrong with my windows SDK or the camera pointer?

jwm
  • 4,832
  • 10
  • 46
  • 78
  • this mean that you not include User32.lib to linker input – RbMm Nov 26 '22 at 00:18
  • How to include the lib file? Do I need to configure some environment paths or qt .pro file? – jwm Nov 26 '22 at 00:19
  • You need to link to it. If you're using a .pro file, then you need to configure it in there. – ChrisMM Nov 26 '22 at 00:26
  • what commands to add in a .pro file? Thanks! – jwm Nov 26 '22 at 00:56
  • I add "LIBS += -luser32" in the file. It seems to the solution. – jwm Nov 26 '22 at 00:59
  • @RbMm can you educate me what the User32.lib is typically used for? I did some similar projects using earlier versions of Qt and Visual studio, which worked but without explicitly including user32.lib – jwm Nov 26 '22 at 01:25
  • In the very documentation of the `MsgWaitForMultipleObjects` API function you have linked in your question, there is Requirements section at the end, in which there is mentioned: "**Library** User32.lib". This tells you what library to link against when using this API function. – heap underrun Nov 26 '22 at 04:28

0 Answers0