Solved Can't use functions from Windows.h
-
Tried totaly same code in VisualStudio(except stuff inside if/else block, in VS i've simple cout's), can't figure out whats wrong, in VS everything works, when in Qt dummy project from the beginning got 2 errors from those 2 functions:
-
Check out your toolchains in creator respectively Kits.
In creator V4.7 under "Tools"->"Options"->"Kits"
or previous versions under "Tools"->"Options"->"Build&Run"Go through the tabs and search for warning signs.
-
@koahnig I dont see there any warning signs, just two my Kits
-
Did you check all tabs?
My guess is that there is a problem with the compiler setup and the library is missing.
IIRC the library has to added when you use MinGW, but you are using VS. Therefore, it is a bit out of my recent experience.
-
Hi @Engelard
Try adding
LIBS += -luser32
in your.pro
file.Afterwards, run qmake and build again.
Regards
-
@aha_1980 said in Can't use functions from Windows.h:
LIBS += -luser32
Omg why i have to do such complicated stuff at the first place. Qt devs, pls fix.
Tnx btw, now there is no error.
-
@Engelard said in Can't use functions from Windows.h:
Omg why i have to do such complicated stuff at the first place. Qt devs, pls fix.
What should be fixed? You are using functions from an external library, so you have to link against it.
You have to do the same on the other platforms also - pretty standard behavior.
Regards
-
@aha_1980 ok, my mistake then