Bonjour,

J'essaye de me mettre � QT et j'ai un probl�me de compilation.

J'utilise RedHat 8.0
QT 3.0.5

[EMAIL PROTECTED] qt]$ cat main.cpp
#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();
}

[EMAIL PROTECTED] qt]$ qmake -project
[EMAIL PROTECTED] qt]$ qmake
[EMAIL PROTECTED] qt]$ make
g++  -o qt main.o    -L/usr/X11R6/lib -lXext -lX11 -lm
main.o: In function `main':
main.o(.text+0x30): undefined reference to 
`QApplication::QApplication[in-charge](int&, char**)'
main.o(.text+0x40): undefined reference to 
`QString::QString[in-charge](char const*)'
main.o(.text+0x5c): undefined reference to 
`QPushButton::QPushButton[in-charge](QString const&, QWidget*, char 
const*)'
main.o(.text+0x77): undefined reference to `QString::shared_null'
main.o(.text+0x81): undefined reference to `QStringData::deleteSelf()'
main.o(.text+0x99): undefined reference to `QPushButton::resize(int, int)'
main.o(.text+0xa5): undefined reference to 
`QApplication::setMainWidget(QWidget*)'
main.o(.text+0xad): undefined reference to `QWidget::show()'
main.o(.text+0xb5): undefined reference to `QApplication::exec()'
main.o(.text+0xbf): undefined reference to `QPushButton::~QPushButton 
[in-charge]()'
main.o(.text+0xc7): undefined reference to `QApplication::~QApplication 
[in-charge]()'
main.o(.text+0xd9): undefined reference to `QString::shared_null'
collect2: ld a retourn� 1 code d'�tat d'ex�cution
make: *** [qt] Erreur 1

Il semblerait (suite � des recherches sur google) qu'il me manque "-lqt" ou 
"-lqt-mt" comme flag de compilation. J'ai essay� de les mettre mais ils 
sont introuvables, alors que si je fais:
[EMAIL PROTECTED] qt]$ /sbin/ldconfig --print-cache | grep libqt
        libqtmcop.so.1 (libc6) => /usr/lib/libqtmcop.so.1
        libqthreads.so.0 (libc6) => /usr/lib/libqthreads.so.0
        libqt.so.3.0.5 (libc6) => /usr/lib/qt-3.0.5/lib/libqt.so.3.0.5
        libqt.so.3.0 (libc6) => /usr/lib/qt-3.0.5/lib/libqt.so.3.0
        libqt.so.3 (libc6) => /usr/lib/qt-3.0.5/lib/libqt.so.3
        libqt.so (libc6) => /usr/lib/qt-3.0.5/lib/libqt.so
        libqt-mt.so.3.0 (libc6) => /usr/lib/qt-3.0.5/lib/libqt-mt.so.3.0
        libqt-mt.so.3 (libc6) => /usr/lib/qt-3.0.5/lib/libqt-mt.so.3
        libqt-mt.so (libc6) => /usr/lib/qt-3.0.5/lib/libqt-mt.so
ils semblent �tre la.. 

J'ai �galement:
[EMAIL PROTECTED] ysagon]$ echo $QTDIR
/usr/lib/qt3-gcc3.2

Voila, si quelqu'un � un d�but de piste, je serai tr�s content!

-- 
Yann Sagon
_______________________________________________
gull mailing list
[EMAIL PROTECTED]
http://lists.alphanet.ch/mailman/listinfo/gull

Répondre à