PDA

View Full Version : Problem while creating a main window



Harini
7th November 2013, 10:39
I'm new to qt. well,I want to design a main window here I'm facing a problem with the following errors
:confused:

/home/stesalit/Desktop/tasks/mainmenu/main.cpp:7: error: ‘MainWindow’ was not declared in this scope
/home/stesalit/Desktop/tasks/mainmenu/main.cpp:7: error: expected ‘;’ before ‘w’
/home/stesalit/Desktop/tasks/mainmenu/main.cpp:8: error: ‘w’ was not declared in this scope


Here are the screen shots of my files in attachments, can anyone please help me out in rectifying those errors ??

Lesiok
7th November 2013, 10:46
Because in main.cpp You don't include header file with MainWindow definition. I think that this is ui_mainwindow.h file.
This is not Qt problem but basis of C++.

anda_skoa
7th November 2013, 11:39
The problem is that the class in mainwindow.h is called "Mainmenu", not "MainWindow"

Given that it is called "MainWindow" in mainwindow.cpp, my suggestion would be to fix mainwindow.h

Cheers,
_