linux user group brescia

immagine del castello

Archivio della mailing list

Compilare tutorial Qt

Carlo Sardi carlo.sardi a lugbs.linux.it
Mer 18 Ott 2006 15:31:59 UTC
Alle 16:09, mercoledì 18 ottobre 2006, Diego Guella - SIRCOM ha scritto:
> Ciao a tutti,
> Devo imparare a usare le librerie Qt, e dopo essermi letto il whitepaper,
> sto seguendo il tutorial #1. Problema: dopo aver copiato il file, tento di
> compilarlo, dicono di eseguire: -----
> qmake -project
> qmake
> make
> -----
>
> qmake -project: ok, mi genera qt.pro
> qmake: ok, mi genera Makefile
> make: ahi, questo mi ritorna questo errore:
>
> -----
> server1950:/opt/apps/qt # make
> g++ -c -pipe -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g
> -DUSE_LIB64_PATHES -fno-strict-aliasing -Wall -W -O2 -fmessage-length=0
> -Wall -D_FORTIFY_SOURCE=2 -g -DUSE_LIB64_PATHES -fno-strict-aliasing
> -DQT_NO_DEBUG  -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include
> -I/usr/lib/qt3/include -o main.o main.cpp g++  -o qt main.o   
> -L/usr/lib64/ -L/usr/X11R6/lib64/ -lXext -lX11 -lm main.o: In function
> `main':
> /opt/apps/qt/main.cpp:8: undefined reference to
> `QApplication::QApplication(int&, char**)' /opt/apps/qt/main.cpp:10:
> undefined reference to `QString::QString(char const*)'
> /opt/apps/qt/main.cpp:10: undefined reference to
> `QPushButton::QPushButton(QString const&, QWidget*, char const*)' main.o:
> In function `~QString':
> /usr/lib/qt3/include/qstring.h:847: undefined reference to
> `QString::shared_null' /usr/lib/qt3/include/qstring.h:848: undefined
> reference to `QStringData::deleteSelf()' main.o: In function `main':
> /opt/apps/qt/main.cpp:11: undefined reference to `QPushButton::resize(int,
> int)' /opt/apps/qt/main.cpp:13: undefined reference to
> `QApplication::setMainWidget(QWidget*)' /opt/apps/qt/main.cpp:14: undefined
> reference to `QWidget::show()' /opt/apps/qt/main.cpp:15: undefined
> reference to `QApplication::exec()' /opt/apps/qt/main.cpp:15: undefined
> reference to `QPushButton::~QPushButton()' /opt/apps/qt/main.cpp:15:
> undefined reference to `QApplication::~QApplication()' main.o: In function
> `~QString':
> /usr/lib/qt3/include/qstring.h:847: undefined reference to
> `QString::shared_null' /usr/lib/qt3/include/qstring.h:848: undefined
> reference to `QStringData::deleteSelf()' main.o: In function `main':
> /opt/apps/qt/main.cpp:15: undefined reference to
> `QApplication::~QApplication()' /opt/apps/qt/main.cpp:15: undefined
> reference to `QPushButton::~QPushButton()'
> main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x18): undefined reference
> to `QGList::clear()' main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x20):
> undefined reference to `QGList::~QGList()'
> main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x28): undefined reference
> to `QGList::~QGList()' main.o:(.rodata._ZTV6QGList[vtable for
> QGList]+0x30): undefined reference to `QPtrCollection::newItem(void*)'
> main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x40): undefined reference
> to `QGList::compareItems(void*, void*)' main.o:(.rodata._ZTV6QGList[vtable
> for QGList]+0x48): undefined reference to `QGList::read(QDataStream&,
> void*&)' main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x50): undefined
> reference to `QGList::write(QDataStream&, void*) const'
> main.o:(.rodata._ZTI6QGList[typeinfo for QGList]+0x10): undefined reference
> to `typeinfo for QPtrCollection' collect2: ld returned 1 exit status
> make: *** [qt] Error 1
> -----
>
>
> ho gogglato un pò in giro, ma ho trovato solo roba antica (1997, 1998) o
> gente con problemi di compilatori. Ah dimenticavo, ho Suse 10.1, e ho
> provato anche su un pc con Suse 9.3 ma ritorna più o meno lo stesso errore.
> Qualcuno sa dirmi cosa c'è che non va?

Hai messo gli headers <QApplication>, ecc ..?

C.




Maggiori informazioni sulla lista Lug