I\'m trying to compile a simple helloworld-like non-Qt C++ application using te WinAPI in QtCreator. Here\'s the code:
#include
int main()
-L
sets the search paths for DLLs, but it doesn't actually link anything. The actual linking is done via -l
. Setting the search path for system libraries shouldn't be necessary, but you'll need to link against user32:
win32:LIBS += -luser32
Additional to Frank's answer (which helped me very much, thanks for that!) I would like to add that this is only required vor MSVC, MinGW doesn't seem to need that line. Which was for me the most confusing part, I first thought I had problems with the msvc toolchain.
My inclusion now looks like this to reflect this fact:
msvc: LIBS += -luser32