PDA

View Full Version : Error trying to compile a simple code: Q_OBJECT



deemeetar
4th November 2009, 21:43
I have

C:/Users/dimitar/Documents/trebovano-isporacano/mainWindow.h:14: error: ISO C++ forbids declaration of `Q_OBJECT' with no type

The code is :


#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#incluse <QMainWindow>

class mainWindow : public QMainWindow
{ Q_OBJECT

public:
MainWindow();
protected:
void closeEvent(QCloseEvent *event);



}


#endif // MAINWINDOW_H


Whats the problem?

just found out i wrote incluse instead of include :D. nvm delete the topic :(*

squidge
4th November 2009, 22:31
Looks to me like it can't find the include file

lyuts
9th November 2009, 09:31
Looks like you misspelled the word "include". And your class definition should end with a semi-colon.