Build a project in command prompt
-
Hi forum
I just starting self study on Qt
I am trying the first example in book " c++gui programming with qt 4-2nd edition By Jasmin Blanchette; Mark Summerfield"
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}My Qt is the latest version
can somebody tel me how to build this simple project in command line?
I tried and had this error
" project error: failed to parse default search path from compiler output" -
Hi and welcome to the forums
Normally you would have a . pro file also ? ( a project file)Why not just use QtCreator ( the Editor ) and make a default project from the New project menu
and then put your code in its main.cpp.
That way linking to the Qt libraries and and other stuff is already in order. -
Hi and welcome to devnet,
To add to @mrjj :
1) qmake -project "QT += widgets" 2) qmake 3) make
The first one will create a project with the required Qt module for widgets.
The second will create the Makefile.
The third trigger the compilation.