Hi, On 2007-01-07 17:50:21 +0100, Lars Steen wrote:
Hallo Liste
Ich hab ein Problem unter 10.2 von openSuSE Ich versuche das Programm "Hello World" zu compilieren! Hört sich einfach - dachte ich auch
Hier das Listing: #ifdef HAVE_CONFIG_H #include
#endif #include
#include #include #include int main(int argc, char* argv[]) { QApplication myApp(argc, argv); QLabel* myLabel = new QLabel("Hello world"); myLabel->resize(80, 30); myApp.setMainWidget(&myLabel); myLabel->show();
return myApp.exec(); }
Ich erhalte beim compilieren mit Kdevelop folgende Fehlermeldung:
hello4.cpp: In function ‘int main(int, char**)’: hello4.cpp:15: error: ‘class QApplication’ has no member named ‘setMainWidget’
Kann es sein, dass du 'nen qt3 Programm hast und qt4 installiert hast? In qt4 gibt es diese Methode nicht mehr (siehe auch http://doc.trolltech.com/4.2/porting4.html#qapplication (Punkt2)). Kommentiere das am "myApp.setMainWidget(&myLabel);" einfach aus/lösche es. Überarbeite am besten deine "Includes" auch noch: #include <qapplication> #include <qlabel> Den Rest kannst du dir sparen. Marcus --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org