1
votes

I'm trying to learn how to use Qt for dev and have to say it's been a pain from the start.

I installed Qt Creator 5.4 version. Then followed this http://qt-project.org/wiki/Qt_for_beginners_Hello_World.

It defaulted to MSVS so I manually added MinGw. It has a red sign next to it saying that MinGW cannot compile code for the QT version.

I just want to use Qt5 and need an appropriate compiler for it. I'm used to using MinGW in Eclipse for C++ dev.

1
You cannot use Qt5 libs with MinGw, try download Qt5 SDK version with MinGw, those are different. First try if Qt Maintenance Tool have Qt5 version for MinGw available in package manager.Arpegius
Hint: try the MSYS2 package and get Qt compiled binaries for MinGWIt's Your App LLC
As @Arpegius said: Qt5MSVC cannot be used for MinGW. There is a MinGW Package available and also the installer supports it. This is actually not a Qt problem, this is like installing eclipse for java with javac and trying to compile c++ code... Nevertheless if you installed sources within your package you still could compile the current installed libraries with your current MinGW Compiler, but this can become a real pain.Sebastian Lange

1 Answers

3
votes

Your installation seems to be incomplete or inconsistent.

To work with Qt you actually need two things: One is a compiler toolchain (called the "kit" in Qt Creator), the other is the compiled Qt library, which is what is visible in settings under "Qt versions". Both need to fit together for Qt to work.

In case you want to use Qt with Visual Studio, you should select the precompiled Qt version corresponding to your (previously installed) VS version during install when you use the online installer. Or use the offline installer for your VS version. After install, everything finds together itself.

Or you want to use MinGW. Do yourself a favor and use the MinGW version which is installed by the Qt installer, which is different to the one from MinGW.org (it is the 32 bit version of the MinGW-w64 project, which is more up to date than the one from MinGW.org, and has some other subtleties). It is selectable in the installer under "tools". Additionally select the Qt version precompiled with MinGW. After install, select the MinGW Kit for your new project, and everything again will work from scratch. Again, you can use either the offline installer including MinGW-precompiled Qt or the online-installer which has all versions of precompiled selectable to perform that installation.