Reputation: 462
So I wanted to use travis for this project today. Sadly it failed with this error:
$ make
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt5/mkspecs/linux-g++-64 -I. -I. -I/usr/include/qt5 -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -o downloadmanager.o downloadmanager.cpp
In file included from downloadmanager.h:11:0,
from downloadmanager.cpp:1:
mainwindow.h:4:23: fatal error: QMainWindow: No such file or directory
compilation terminated.
make: *** [downloadmanager.o] Error 1
The command "make" exited with 2.
Here is the full log.
Note I first had problems with it not recognizing the Network module file (e.g. QNetworkAccessManager). I fixed this by executing QMake with "QT += network". Now it cannot find the GUI files (e.g. QMessageBox) but adding "QT += network gui" did not do the trick.
Upvotes: 0
Views: 474
Reputation: 7777
You need to add widgets
to get classes such as QMessageBox
and QMainWindow
:
QT += widgets network gui
For future reference, please consult the Qt 5 documentation. The page for each class indicates what must be added to your qmake
for that class (right at the top of the page). See, for example, the page for QMessageBox
.
Upvotes: 1