You certainly do not need to use QtCreator to write a Qt program.
You also don't need to use qmake , but you ask for the problem without using it.
To do anything even remotely interesting in Qt, you will inevitably end up subclassing QObject . All of these subclasses require the Q_OBJECT macro in their definition, which allows signal / slot syntax. This syntax is not regular C ++ and cannot be compiled using g ++. Files containing class definitions using Q_OBJECT must be executed through the Qt metaobject compiler called moc . This means that you need to decide which files the moc should have for them, then run moc on them, and then compile the resulting cpp file with g++ . It is for this reason that Qt delivers qmake . It generates the correct rules in the Makefile for you.
The Qt.pro project files are really very easy to use, and I would seriously recommend using them. Remember that qmake is a command line tool similar to g++ . In addition, it can actually create a skeleton project file for you by providing the -project , so for starters you can just do
qmake -project qmake make
and you're done. In practice, I found that in the generated project file there might be no declaration of any additional Qt libraries that I could use, so you may need to add a line like
QT += opengl
if, for example, you included something like QGLWidget .
Troubadour Sep 03 2018-10-09T00: 00Z
source share