Cannot compile first example of "Qt for Beginners" wiki page
-
@Dekeon said in Can not compile first example of "Qt for Beginners" wiki page:
I made a Qt Widget and I got the same result, but with a bunch more errors of the same kind:
undefined reference to...Please go to Tools->Options->Build&Run and take a screenshot of the Kits tab
-
Can you add widget in the following way (file .pro)?
QT = core gui widgets
-
@Charlie_Hdz said in Cannot compile first example of "Qt for Beginners" wiki page:
QT = core gui widgets
Tried in both the projects, getting the same errors still.
-
Here is another solution:
You have a mismatch between VS libraries and MINGW... Trying downloading the VS kit from https://www1.qt.io/download/
-
I got the same issue a time ago, having VS and using Qt Creator in the same OS...
Show me the issue description of the kits.
Can you delete all the kits that had issues.
Display the DEsktop MinGW kit and show me the information there. -
Here's the informations about a kit with a red sign:
Here's the one I've selected as default:
I can't seem to be able to delete the ones that are marked red. I've tried the maintenance tool, but I don't know what to de-select and if it's even the right thing to do. Here's my maintenance tool selection screen anyways:
-
@Dekeon said in Cannot compile first example of "Qt for Beginners" wiki page:
What does VS stand for? I don't see anything resembling VS kit to download anywhere.
"VS" stands for "Visual Studio" by Microsoft. It is also known as "MSVC" ("Microsoft Visual C/C++").
If you want to use a VS/MSVC kit, then you need to download Visual Studio from Microsoft. However, since you already have MinGW installed, you can just use the MinGW kit.
@Dekeon said in Cannot compile first example of "Qt for Beginners" wiki page:
I can't seem to be able to delete the ones that are marked red. I've tried the maintenance tool, but I don't know what to de-select and if it's even the right thing to do. Here's my maintenance tool selection screen anyways:
The red exclamation marks are there because you have installed kits that you can't use (for example, you haven't installed MSVC so you can't use the MSVC kits).
Expand "Qt 5.10.0" and untick all the MSVC, UWP, and Android kits. Make sure you leave the MinGW kit installed.
-
To expand @JKSH explanation... I did a test in my rusty Windows (I prefer Linux) with your code. It compiled.
I attached some figures for your reference in the Compiler/Kits configuration. (Qt 5.7.1 (MSVC 2015 32 bits)
Hope your application works.. I remembered that I had issues when I got Qt Creator when I had VS installed. So feel accompanied!
-
Good news, can you set the thread as Solved, please?