LIBS += -lUser32 is no longer working
-
@Engelard Well, the last pictures shows that you selected 32bit compiler for 64bit Qt. Simply select correct compiler...
Also, if you want to build 32bit application you also need 32bit Qt - those are not provided by Qt Company as prebuilt binaries anymore, you will have to build Qt by yourself.@jsulm said in LIBS += -lUser32 is no longer working:
Also, if you want to build 32bit application you also need 32bit Qt
i have that as well! Was using both for many years, just forgot that little thing. x32 Qt auto-detected Kits and compiler, and gives same error when i try select Mingw in C++ compiler field:
-
@jsulm said in LIBS += -lUser32 is no longer working:
Also, if you want to build 32bit application you also need 32bit Qt
i have that as well! Was using both for many years, just forgot that little thing. x32 Qt auto-detected Kits and compiler, and gives same error when i try select Mingw in C++ compiler field:
-
-
Oh.. Now i feel really dumb, for some reason this "environment setuping" aspect for me was way harder then actual programming.
Ah, and one thing changed last year actually. I uninstalled old(probably was like 2019) Visual Studio and installed new 2022, maybe that's the case why it struggle to auto-detect.
And i launched Qt creator now, in auto-detected Kit compilers not set, and can't be set because they blocked(grey)
UPDATE:
I've found that i have such path specified in my environment variables:
There is no even such folder '2017' actually, and i have VS2022 which is installed on disk :D not :C
-
Oh.. Now i feel really dumb, for some reason this "environment setuping" aspect for me was way harder then actual programming.
Ah, and one thing changed last year actually. I uninstalled old(probably was like 2019) Visual Studio and installed new 2022, maybe that's the case why it struggle to auto-detect.
And i launched Qt creator now, in auto-detected Kit compilers not set, and can't be set because they blocked(grey)
UPDATE:
I've found that i have such path specified in my environment variables:
There is no even such folder '2017' actually, and i have VS2022 which is installed on disk :D not :C
-
@jsulm Tried that. Did'nt change anything. Still only 4 auto-detected amd-compilers, which i can't use in Kit because field for compilers is grayed out
@Engelard Please show a screen shot of your Kit. Are there any warnings/errors? What exact compilers are shown (please show screen shot of your Compilers tab) and what Kit are you trying to configure (Qt for MinGW or Qt for VSVC?)?
-
@Engelard Your PATH environment variable looks extremely polluted. There's absolutely no reason to have compilers, libs and even includes (???) in there. That's just asking for problems when all of them from different toolkits are in the same search path. These paths should be set as part of kits in Qt Creator, not globally. Remove any compiler or Qt related directories from your PATH.
Still only 4 auto-detected amd-compilers
There's no such thing as amd compiler. amd64 (or x64) is an architecture.
On your previous screens you have all the compilers you need autodetected:For 32bit build - Microsoft Visual C++ Compiler 17.0.32112.339 (x86)
For 64bit build - Microsoft Visual C++ Compiler 17.0.32112.339 (amd64) -
@Engelard Your PATH environment variable looks extremely polluted. There's absolutely no reason to have compilers, libs and even includes (???) in there. That's just asking for problems when all of them from different toolkits are in the same search path. These paths should be set as part of kits in Qt Creator, not globally. Remove any compiler or Qt related directories from your PATH.
Still only 4 auto-detected amd-compilers
There's no such thing as amd compiler. amd64 (or x64) is an architecture.
On your previous screens you have all the compilers you need autodetected:For 32bit build - Microsoft Visual C++ Compiler 17.0.32112.339 (x86)
For 64bit build - Microsoft Visual C++ Compiler 17.0.32112.339 (amd64)@Chris-Kawa said in LIBS += -lUser32 is no longer working:
Remove any compiler or Qt related directories from your PATH.
Done. Nothing changed in Qt Creator.
@Engelard Please show a screen shot
Warning that there is no compiler set).
Screens from x64 Qt creator.
-
Done. Nothing changed in Qt Creator.
Well apparently it has. Now you somehow have two of the same cross compilers (x86_amd64) and no 64bit compiler (amd64). I don't see how this is possible by editing PATH. What did you do exactly?
-
Done. Nothing changed in Qt Creator.
Well apparently it has. Now you somehow have two of the same cross compilers (x86_amd64) and no 64bit compiler (amd64). I don't see how this is possible by editing PATH. What did you do exactly?
@Chris-Kawa Just removed from path like 3-4 paths of compiler/VS/Qt related things. Only one of them was recent, which was pointing to the VS2022 compiler directory, other - old/outdated paths of Qt/VS.
Now opened Qt creator, x64 compiler in C++ field is present, 4/4 compilers in both, everything remains the same.
It starts to become really tedious task, i 'm thinking about reinstall everything or something like that. When IDE stop functioning for unknown for me reason - i begin to remember what i hates the most about being the programmer....
But best solution might be just GIVE UP on Microsoft compiler, and try to install some other popular, like GNU.I'll report here how it went.
-
Ah... I just find out that GNU compiler is also GCC, and it is also MinGW. For some reason it has many names. And i can't select it for any Kit because it seems like i have x32 version only.
I noticed one little thing which i thought is not important and i decided not mention it, but now i'm wondering. Why this error in Kit appears only when i select C++ compiler, and never rise when i do the same selection for C?
-
I just find out that GNU compiler is also GCC, and it is also MinGW. For some reason it has many names.
It doesn't, those are different things. GNU is not a compiler. It's a set of free software made for Unix like operating systems. GCC stands for GNU Compiler Collection and it's a set of compilers for multiple languages. It's just one of many elements of the GNU project. MinGW stands for Minimalist GNU for Windows and it's a Windows port of some of the GNU tools, including GCC.
As for your problem. For some reason wrong abi is detected for your compiler. Go to the compilers tab, select the amd64 compiler and see what ABI is detected in the properties below. It should be
x86-windows-msvc2022-pe-64bit
. If it's not try to click the Remove All button and then Re-detect and check the ABI then. -
I just find out that GNU compiler is also GCC, and it is also MinGW. For some reason it has many names.
It doesn't, those are different things. GNU is not a compiler. It's a set of free software made for Unix like operating systems. GCC stands for GNU Compiler Collection and it's a set of compilers for multiple languages. It's just one of many elements of the GNU project. MinGW stands for Minimalist GNU for Windows and it's a Windows port of some of the GNU tools, including GCC.
As for your problem. For some reason wrong abi is detected for your compiler. Go to the compilers tab, select the amd64 compiler and see what ABI is detected in the properties below. It should be
x86-windows-msvc2022-pe-64bit
. If it's not try to click the Remove All button and then Re-detect and check the ABI then.@Chris-Kawa said in LIBS += -lUser32 is no longer working:
It should be x86-windows-msvc2022-pe-64bit
It is that 2005, i have no idea how i have exactly that one.
@Chris-Kawa said in LIBS += -lUser32 is no longer working:
If it's not try to click the Remove All button and then Re-detect and check the ABI then.
Tried already few days ago. Same compilers i get.
BTW, that MinGW in manual section, i did'nt put that there, it appears after remove/redetect actions. Weird.
-
I found that i have in my system much more MS Redistributables then i need, and i suspected Qt might detect some oldest version, instead of newest. So i deleted all, and installed the latest, but nothing changed...
Still that strange 2005 version, and i don't know what to do with it, i have VS 2022, with it obviously comes latest compiler.
-
Hi, to get rid of some of those historical artifacts, you could try creating a new user on your Windows PC and installing Qt logged in as that new user. And if that doesn't cut it, perhaps reformatting your C: and installing a brand new Windows is your best bet (but make a backup first :-)
-
Hi, to get rid of some of those historical artifacts, you could try creating a new user on your Windows PC and installing Qt logged in as that new user. And if that doesn't cut it, perhaps reformatting your C: and installing a brand new Windows is your best bet (but make a backup first :-)
@hskoglund no, i can not reinstall Windows.
I want to understand first, is this problem on side of Qt, or Microsoft compiler?
UPD:
It definitely something wrong with Qt, i can't add MinGW(which i was using back then year ago), same issue "The compiler blablabla cannot produce code for Qt Version" -
@hskoglund no, i can not reinstall Windows.
I want to understand first, is this problem on side of Qt, or Microsoft compiler?
UPD:
It definitely something wrong with Qt, i can't add MinGW(which i was using back then year ago), same issue "The compiler blablabla cannot produce code for Qt Version"@Engelard As we said before - you can't mix MinGW with Qt build for MSVC. That's what the message is saying. If you want to use MinGW you need Qt build for MinGW.
If you go to
%appdata%/QtProject/qtcreator/
there's a filetoolchains.xml
. Close Qt Creator, make a backup of that file, delete it and start Qt Creator again. It should redetect everything. If it doesn't on its own press Re-detect on the compilers tab. Does it detect the correct 2022 abi then? -
@Engelard As we said before - you can't mix MinGW with Qt build for MSVC. That's what the message is saying. If you want to use MinGW you need Qt build for MinGW.
If you go to
%appdata%/QtProject/qtcreator/
there's a filetoolchains.xml
. Close Qt Creator, make a backup of that file, delete it and start Qt Creator again. It should redetect everything. If it doesn't on its own press Re-detect on the compilers tab. Does it detect the correct 2022 abi then?@Chris-Kawa said in LIBS += -lUser32 is no longer working:
As we said before - you can't mix MinGW with Qt build for MSVC
I get it, i mean, i was using MinGW Kit before, and now with current mess - i can't. It was properly setuped back then.
@Chris-Kawa said in LIBS += -lUser32 is no longer working:
delete it and start Qt Creator again
After deleting toolchains something finally changed! It allows me to select proper compilers at least in 'Replacement(whatever that is)' Kit, and it gives normal icon instead of warning or error. But it's complaining in project scope now that there is no Kits to select, but i tried to create new project, and there was option to select that new 'Replacement" kit. After project creation it give out me same complaint and it's not working, but at least some progress i have now. Thank you.
-
@Chris-Kawa said in LIBS += -lUser32 is no longer working:
As we said before - you can't mix MinGW with Qt build for MSVC
I get it, i mean, i was using MinGW Kit before, and now with current mess - i can't. It was properly setuped back then.
@Chris-Kawa said in LIBS += -lUser32 is no longer working:
delete it and start Qt Creator again
After deleting toolchains something finally changed! It allows me to select proper compilers at least in 'Replacement(whatever that is)' Kit, and it gives normal icon instead of warning or error. But it's complaining in project scope now that there is no Kits to select, but i tried to create new project, and there was option to select that new 'Replacement" kit. After project creation it give out me same complaint and it's not working, but at least some progress i have now. Thank you.