[C++] compilation de programme qt

compilation de programme qt [C++] - Programmation

Marsh Posté le 19-07-2001 à 20:58:58    

lut  
 
j'aimerais savoir quel est la ligne de commande pour compiler des progs avec qt sous linux
 
voici (une partie) les erreurs que g++ me sort lorsque j'essaye simplement de compiler le premier tutorial ( le hello world)
 
 
/tmp/cc7bxZdV.o: In function `main':
 
/tmp/cc7bxZdV.o(.text+0x1a): undefined reference to `QApplication::QApplication(int &, char **)'
 
/tmp/cc7bxZdV.o(.text+0x31): undefined reference to `QString::QString(char const *)'
 
/tmp/cc7bxZdV.o(.text+0x4d): undefined reference to `QPushButton::QPushButton(QString const &, QWidget *, char const *)'
 
/tmp/cc7bxZdV.o(.text+0x83): undefined reference to `QPushButton::resize(int, int)'
 
/tmp/cc7bxZdV.o(.text+0x99): undefined reference to `QApplication::setMainWidget(QWidget *)'
 
/tmp/cc7bxZdV.o(.text+0xab): undefined reference to `QWidget::show(void)'
 
/tmp/cc7bxZdV.o(.text+0xba): undefined reference to `QApplication::exec(void)'
 
/tmp/cc7bxZdV.o(.text+0xd0): undefined reference to `QPushButton::~QPushButton(void)'
 
/tmp/cc7bxZdV.o(.text+0xe1): undefined reference to `QApplication::~QApplication(void)'
 
/tmp/cc7bxZdV.o(.text+0x12d): undefined reference to `QPushButton::~QPushButton(void)'
 
/tmp/cc7bxZdV.o(.text+0x140): undefined reference to `QApplication::~QApplication(void)'
 
/tmp/cc7bxZdV.o(.rodata+0xb8): undefined reference to `QDropEvent type_info node'
 
/tmp/cc7bxZdV.o: In function `QArray<char> type_info function':
 
/tmp/cc7bxZdV.o(.gnu.linkonce.t.__tft6QArray1Zc+0x10): undefined reference to `QGArray type_info function'
 
/tmp/cc7bxZdV.o(.gnu.linkonce.t.__tft6QArray1Zc+0x1a): undefined reference to `QGArray type_info node'
 
/tmp/cc7bxZdV.o: In function `QTimerEvent type_info function':
 
/tmp/cc7bxZdV.o(.gnu.linkonce.t.__tf11QTimerEvent+0x10): undefined reference to `QEvent type_info function'
 
/tmp/cc7bxZdV.o(.gnu.linkonce.t.__tf11QTimerEvent+0x1a): undefined reference to `QEvent type_info node'
 
/tmp/cc7bxZdV.o: In function `QMouseEvent type_info function':
 
/tmp/cc7bxZdV.o(.gnu.linkonce.t.__tf11QMouseEvent+0x10): undefined reference to `QEvent type_info function'
 
 
(j'ai utiliser "g++ essais.cpp -I /usr/local/qt/include  -L /usr/local/qt/lib" comme ligne de commande)

Reply

Marsh Posté le 19-07-2001 à 20:58:58   

Reply

Marsh Posté le 19-07-2001 à 21:32:43    

tu as tout simplement oublié de spécifier la librairie en paramtere lors du linkage : -lqt2 ou -lqt devrait résoudre ton probleme (a mettre dans le makefile)
Y a aussi une variable d'environnement qui résoud ce pb ( $QT_DIR  ou quelque chose comme ca, a vérifier) a foutre aussi dans le makefile.

Reply

Marsh Posté le 19-07-2001 à 21:39:53    

merci ca marche ( c -lqt) :)

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed