cjanscen
10-04-2003, 11:49 PM
I know I am doing something really stupid (and really small), but I don't know what!? Why does this not compile:
#include <qapplication.h>
#include <qpushbutton.h>
int main( int argc, char **argv ) {
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
a.setMainWidget( &hello );
hello.show();
return a.exec(); }
I do this:
g++ ./main.cpp
It does this:
main.cpp:1:26: qapplication.h: No such file or directory
main.cpp:2:25: qpushbutton.h: No such file or directory
main.cpp: In function `int main(int, char**)':
main.cpp:7: `QApplication' undeclared (first use this function)
main.cpp:7: (Each undeclared identifier is reported only once for each function it appears in.) main.cpp:7: syntax error before `(' token main.cpp:9: `QPushButton' undeclared (first use this function) main.cpp:10: `hello' undeclared (first use this function)
main.cpp:12: `a' undeclared (first use this function)
#include <qapplication.h>
#include <qpushbutton.h>
int main( int argc, char **argv ) {
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
a.setMainWidget( &hello );
hello.show();
return a.exec(); }
I do this:
g++ ./main.cpp
It does this:
main.cpp:1:26: qapplication.h: No such file or directory
main.cpp:2:25: qpushbutton.h: No such file or directory
main.cpp: In function `int main(int, char**)':
main.cpp:7: `QApplication' undeclared (first use this function)
main.cpp:7: (Each undeclared identifier is reported only once for each function it appears in.) main.cpp:7: syntax error before `(' token main.cpp:9: `QPushButton' undeclared (first use this function) main.cpp:10: `hello' undeclared (first use this function)
main.cpp:12: `a' undeclared (first use this function)