Debugging Qt issues
-
So I made a qt widget copying the generic widget from the gui wizard. I triple checked me widget.cpp, widget.h files, and main file against the one created by the gui wizard. It doesn't compile.
The errors are in my ui_widget.h file, which is supposed to be auto-generated. How do I fix this? I can post my code if necessary.
-
Hi,
Posting the error with it is always a good idea. That gives some clues to where the compiler runs into trouble. The ui_x.h file is generated with qmake. When you change something in your designer form, qmake will be updated automatic, but in rare occasions is doesn't. Two ways to try is to run qmake after a clean operation. If that doesn't work, please delete the entire build directory so the compiler is forced to rebuild the entire project including the ui files. -
So, I have a project, and I basically just add a widget form class using the wizard. File>New>Qt>Qt Designer Form Class>Widget>name "dash"
It should compile after that, it compiled before, but it doesn't compile.
The errors are:
In file included from ../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/QApplication:1:0,
from ./ui_dash.h:14,
from ../ROV-Pilot/dash.cpp:2:
../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/qapplication.h:111:24: error: missing binary operator before token "("
../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/qapplication.h:151:24: error: missing binary operator before token "("
../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/qapplication.h:181:24: error: missing binary operator before token "("
In file included from ../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/qabstractitemview.h:47:0,
from ../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/qheaderview.h:45,
from ../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/QHeaderView:1,
from ./ui_dash.h:16,
from ../ROV-Pilot/dash.cpp:2:
../../../Qt5.1.1/5.1.1/gcc/include/QtCore/qitemselectionmodel.h:93:24: error: missing binary operator before token "("
In file included from ../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/QHeaderView:1:0,
from ./ui_dash.h:16,
from ../ROV-Pilot/dash.cpp:2:
../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/qheaderview.h:117:24: error: missing binary operator before token "("
../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/qheaderview.h:124:24: error: missing binary operator before token "("
../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/qheaderview.h:135:24: error: missing binary operator before token "("
In file included from ../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/QAction:1:0,
from ./ui_dash.h:13,
from ../ROV-Pilot/dash.cpp:2:
../../../Qt5.1.1/5.1.1/gcc/include/QtWidgets/qaction.h:61:32: error: expected initializer before ':' token
make: *** [dash.o] Error 1
23:39:39: The process "/usr/bin/make" exited with code 2.