Can Qt access windows SDK functions in a third party static libraries?
-
Hi,
I'm implementing a function to open a window in Qt using a static library call. But the library gives linker errors and found the cause for this is a failure to call windows SDK functions. Tried removing only those function and the linker issues gone.
Example:
ShowWindow() is a function I'm using and it has defined in WinUser.h file. I tried including WinUser.h to my source files. Nothing happens.If Qt can access the third party libraries, why only the functions related to windows are getting failed?
Also the windows SDK used in Qt and Visual Stuido 2015 (used to build libraries) are having the same windows SDK version (10.0.17134.0).
-
According to msdn ( https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-showwindow ) you have to link against user32.lib - are you sure you added this to your LIBS var (I assume you're using qmake)
-
According to msdn ( https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-showwindow ) you have to link against user32.lib - are you sure you added this to your LIBS var (I assume you're using qmake)
Yes I'm using qmake. Also I added 32libs. But same issues still there.
This is my error log
-
@Uddo_ud said in Can Qt access windows SDK functions in a third party static libraries?:
Also I added 32lib
You must add user32.lib - please show us your .pro file
-
@Uddo_ud said in Can Qt access windows SDK functions in a third party static libraries?:
Also I added 32lib
You must add user32.lib - please show us your .pro file
win32:LIBS += -L"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x86" -lUser32
I added this and the issues solved. Thank you @Christian-Ehrlicher for the support.