zenwalk->kompilovanie s Qt

Sekcia: Programovanie 28.11.2006 | 19:25
Avatar Peter Rozum Arch Linux  Používateľ
zdravim! chcem sa zacat zaoberat s Qt, ale este sa mi nepodarilo skompilovat ani helloworld. Qt mam nainstalovane z download.zenwalk.org. zdrojak: #include #include 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(); } kompilovanie: peto[qt]$ qmake -project peto[qt]$ qmake peto[qt]$ make g++ -o qt main.o -L/usr/X11R6/lib -lXext -lX11 -lm main.o(.text+0x1f): In function `main': : undefined reference to `QApplication::QApplication(int&, char**)' main.o(.text+0x32): In function `main': : undefined reference to `QString::QString(char const*)' main.o(.text+0x46): In function `main': : undefined reference to `QPushButton::QPushButton(QString const&, QWidget*, char const*)' main.o(.text+0x5e): In function `main': : undefined reference to `QString::shared_null' main.o(.text+0x69): In function `main': : undefined reference to `QStringData::deleteSelf()' main.o(.text+0x77): In function `main': : undefined reference to `QPushButton::resize(int, int)' main.o(.text+0x80): In function `main': : undefined reference to `QApplication::setMainWidget(QWidget*)' main.o(.text+0x88): In function `main': : undefined reference to `QWidget::show()' main.o(.text+0x90): In function `main': : undefined reference to `QApplication::exec()' main.o(.text+0x9b): In function `main': : undefined reference to `QPushButton::~QPushButton()' main.o(.text+0xa3): In function `main': : undefined reference to `QApplication::~QApplication()' main.o(.text+0xd3): In function `main': : undefined reference to `QString::shared_null' main.o(.text+0xde): In function `main': : undefined reference to `QStringData::deleteSelf()' main.o(.text+0xf7): In function `main': : undefined reference to `QApplication::~QApplication()' main.o(.text+0x117): In function `main': : undefined reference to `QPushButton::~QPushButton()' main.o(.gnu.linkonce.r._ZTV6QGList+0xc): undefined reference to `QGList::clear()' main.o(.gnu.linkonce.r._ZTV6QGList+0x10): undefined reference to `QGList::~QGList()' main.o(.gnu.linkonce.r._ZTV6QGList+0x14): undefined reference to `QGList::~QGList()' main.o(.gnu.linkonce.r._ZTV6QGList+0x18): undefined reference to `QPtrCollection::newItem(void*)' main.o(.gnu.linkonce.r._ZTV6QGList+0x20): undefined reference to `QGList::compareItems(void*, void*)' main.o(.gnu.linkonce.r._ZTV6QGList+0x24): undefined reference to `QGList::read(QDataStream&, void*&)' main.o(.gnu.linkonce.r._ZTV6QGList+0x28): undefined reference to `QGList::write(QDataStream&, void*) const' main.o(.gnu.linkonce.r._ZTI6QGList+0x8): undefined reference to `typeinfo for QPtrCollection' collect2: ld returned 1 exit status make: *** [qt] Error 1 viete poradit co treba? kito
Everything is proceeding as I have foreseen.
    • Re: zenwalk->kompilovanie s Qt 28.11.2006 | 17:51
      Avatar Jozko Mrkvicka Matejovie Gentoo  Používateľ
      no a aku mas vezriu QT tak ku nej si pozri tutorial a to ti musi ist ;D
      A computer is like air conditioning: it becomes useless when you open windows.
      • Re: Re: zenwalk->kompilovanie s Qt 28.11.2006 | 18:03
        Avatar Peter Rozum Arch Linux  Používateľ
        verzia qt je 3.3.6 a priklad aj postup kompilovania mam z Qt Reference Documentation (Qt Assistant)
        Everything is proceeding as I have foreseen.
        • Re: Re: Re: zenwalk->kompilovanie s Qt 28.11.2006 | 19:13
          skywaker   Návštevník
          dufam ze tie #include nemas prazdne -- musis tam uviest prislusnu kniznicu .... inac ti to bude vypisovat ze nepozna funkcie ....
          • Re: Re: Re: Re: zenwalk->kompilovanie s Qt 28.11.2006 | 19:25
            Avatar Peter Rozum Arch Linux  Používateľ
            ospravedlnujem sa za tie #include. len som zabudol ze to nezobrazuje hranate zatvorky... ma to byt takto: #include <qapplication.h> #include <qpushbutton.h>
            Everything is proceeding as I have foreseen.