I have installed C++SDK that have Qt but when I try compiling a code linking QApplication it gives me the error:
Error QApplication: no such file or directory
>
Well, It's a bit late for this but I've just started learning Qt and maybe this could help somebody out there:
If you're using Qt Creator then when you've started creating the project you were asked to choose a kit to be used with your project, Let's say you chose Desktop Qt
. For Qt 5, If you opened the Qt folder of your installation, you'll find a folder with the version of Qt installed as its name inside it, here you can find the kits you can choose from.
You can go to /PATH/FOR/Qt/mingw
and here you'll find all the includes you can use in your program, just search for QApplication
and you'll find it inside the folder QtWidgets
, So you can use #include
since the path starts from the include
folder.
The same goes for other headers if you're stuck with any and for other kits.
Note: "all the includes you can use" doesn't mean these are the only ones you can use, If you include iostream
for example then the compiler will include it from /PATH/FOR/Qt/Tools/mingw