class MainWindow : public QMainWindow; remove the semicolon from the end of the line, you put a semicolon only when you finish a definition or statement, here the class definition isnt over. Put the semi-colon at the end of the mainwindow.h after the last curly brace marking the end of the class definition.