Frage

I'm attempting to get Qt setup to run a simple hello world example, but I can't get the compilation setup right for the IDE (QtCreator). When I attempt to build by pressing the build button, I am getting the following error message:

Qt creator needs a compiler setup to build. Configure a compiler in the kit options

So I noticed that I had nothing setup for the compiler. I then downloaded a MinGW compiler and it seems the IDE managed to recognize it automatically. Still, when I attempt to build I am getting the same error message.

The truth is that I really don't know the process of compilation either from the command line or in other IDEs. I've read that there might be an issue with paths? I'm running on Windows. I would be extremely grateful if someone could explain what I may be doing wrong and what issue I may be having with building in QtCreator.

War es hilfreich?

Lösung

You will need to do the following steps for QtCreator:

1) Go to Settings > Build and Run > Kits.

2) Check if the auto-detection is correct. It is probably not if you have issues, so you will need to either set up manually or rreinstall QtCreator to see if the problem goes away. If it is not detected, you will have a read exclamation mark.

3) Add a new Kit.

4) Type a name.

5) You need to choose the proper "Qt version".

6) You need to choose the compiler.

7) Select the "Make Default" option.

As for command line, you should be able to do something like this to build a simple dummy main.cpp:

main.cpp

int main() {}

and then you can run the following commands in the (msys/cygwin/etc) prompt:

qmake -project && qmake && make
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top