#include <qapplication.h>//#include "unnamed1.h" его у меня нет вобщеint main( int argc, char ** argv ){ QApplication a( argc, argv ); Form1 a; a.show(); a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); return a.exec();}
g++ -c -pipe -Wall -W -O2 -g -pipe -march=i386 -mcpu=i686 -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG -I/usr/lib/qt-3.1/mkspecs/default -I. -I/usr/lib/qt-3.1/include -I.ui/ -I. -I.moc/ -o .obj/main.o main.cppmain.cpp: In function `int main(int, char**)':main.cpp:6: error: syntax error before `;' tokenmain.cpp:7: error: `show' undeclared (first use this function)main.cpp:7: error: (Each undeclared identifier is reported only once for each function it appears in.)make: *** [.obj/main.o] Ошибка 1
#include "file_where_your_Form1_declarated.h"
#include <qapplication.h>#include "form1.h" // <----- если форма называется form1.uiint main( int argc, char ** argv ){ QApplication a( argc, argv ); Form1 frm1; a.setMainWidget(&frm1); frm1.show(); return a.exec();}