#1 Le 07/09/2007, à 11:48
- elodie75
Pb installation Qt4 + vVariables d'envoronnement pour Qt
Bonjour ,
j'essaye d'installer Qt-4.1.1 depuis ce matin , en fait l'installation c'est passé sans problème , j'ai voullu essayer Qt avec ce petit programme :
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
en compilant via make , j'obtiens :
g++ -c -pipe -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o hello.o hello.cpp
hello.cpp:1:24: erreur: QApplication : Aucun fichier ou répertoire de ce type
hello.cpp:2:18: erreur: QLabel : Aucun fichier ou répertoire de ce type
hello.cpp: In function «int main(int, char**)":
hello.cpp:6: erreur: «QApplication" was not declared in this scope
hello.cpp:6: erreur: expected `;' before «app"
hello.cpp:7: erreur: «QLabel" was not declared in this scope
hello.cpp:7: erreur: «label" was not declared in this scope
hello.cpp:7: erreur: expected type-specifier before «QLabel"
hello.cpp:7: erreur: expected `;' before «QLabel"
hello.cpp:9: erreur: «app" was not declared in this scope
hello.cpp: At global scope:
hello.cpp:4: attention : unused parameter «argc"
hello.cpp:4: attention : unused parameter «argv"
make: *** [hello.o] Erreur 1
on ma dit de mettre a jour ma variable d'environemment en ajoutant dansle fichier /etc/profile la ligne
PATH=/usr/local/Trolltech/Qt-4.1.1/bin:$PATH
export PATH
je l'ai fait mais rien a changé , avez vous une idée ??
et aussi ,je souhaite utilisé dorénavant la lettre "C" au lieu de clear pour effacer mon ecrab de console
je sais plus la procedure pour le faire , je me rappelle qu'il fasais utiliser echo ou un truc du genre
merci beaucoup
#2 Le 07/09/2007, à 12:20
- telliam
Re : Pb installation Qt4 + vVariables d'envoronnement pour Qt
essaye de mettre la ligne -I/usr/local/Trolltech/Qt-4.1.1/include ou un truc approchant dans ta ligne de compilation
pour le clear de ton ecran fais "alias C clear"
"- Un intellectuel assis va moins loin qu'un con qui marche."
Maurice Biraud - Un Taxi pour Tobrouk
Michel Audiard
Hors ligne
#3 Le 07/09/2007, à 12:53
- elodie75
Re : Pb installation Qt4 + vVariables d'envoronnement pour Qt
essaye de mettre la ligne -I/usr/local/Trolltech/Qt-4.1.1/include ou un truc approchant dans ta ligne de compilation
pour le clear de ton ecran fais "alias C clear"
pour compiler avec Qt , j'utilise qmake -project , qmake nomfichier.pro et make ,ou est ce que je doit ajouter ??
Ps : l'alias ne marche pas
elo@maison:~$ alias c 'clear'
bash: alias: c: non trouvé
bash: alias: clear: non trouvé
elo@maison:~$ alias ll 'ls -la'
bash: alias: ll: non trouvé
bash: alias: ls -la: non trouvé
#4 Le 07/09/2007, à 13:42
- sbrunner
Re : Pb installation Qt4 + vVariables d'envoronnement pour Qt
Hello !
Remplace:
#include <QApplication>
#include <QLabel>
=>
#include <QtGui/QApplication>
#include <QtGui/QLabel>
et ça doit ce compiler sans problème
CU
Stéph
Hors ligne
#5 Le 07/09/2007, à 14:03
- elodie75
Re : Pb installation Qt4 + vVariables d'envoronnement pour Qt
ca marche toujours pas :(
elo@maison:~/QT 4/hello$ make
g++ -c -pipe -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o hello.o hello.cpp
hello.cpp:1:30: erreur: QtGui/QApplication : Aucun fichier ou répertoire de ce type
hello.cpp:2:24: erreur: QtGui/QLabel : Aucun fichier ou répertoire de ce type
hello.cpp: In function «int main(int, char**)":
hello.cpp:6: erreur: «QApplication" was not declared in this scope
hello.cpp:6: erreur: expected `;' before «app"
hello.cpp:7: erreur: «QLabel" was not declared in this scope
hello.cpp:7: erreur: «label" was not declared in this scope
hello.cpp:7: erreur: expected type-specifier before «QLabel"
hello.cpp:7: erreur: expected `;' before «QLabel"
hello.cpp:9: erreur: «app" was not declared in this scope
hello.cpp: At global scope:
hello.cpp:4: attention : unused parameter «argc"
hello.cpp:4: attention : unused parameter «argv"
make: *** [hello.o] Erreur 1
#6 Le 07/09/2007, à 14:13
- sbrunner
Re : Pb installation Qt4 + vVariables d'envoronnement pour Qt
Hello !
Avec cette commande ca va mieux fonctionner !
g++ -c -pipe -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/include -I. -I. -I/usr/include/qt4 -o hello.o hello.cpp
Si tu utilise qmake es-tu sur d'utiliser la version 4 ?
Pour être sure utilise qmake-qt4.
CU
Stéph
Hors ligne
#7 Le 07/09/2007, à 16:38
- abetsic
Re : Pb installation Qt4 + vVariables d'envoronnement pour Qt
Pour l'alias c'est quelque chose du genre :
alias C='clear'
il me semble, sinon tu peux utiliser ctrl-l qui fait la même chose.
Hors ligne
#8 Le 07/09/2007, à 22:49
- elodie75
Re : Pb installation Qt4 + vVariables d'envoronnement pour Qt
Pour l'alias c'est quelque chose du genre :
alias C='clear'
il me semble, sinon tu peux utiliser ctrl-l qui fait la même chose.
merci l'alias marche
par contre j'arrive toujours pas a compiler sous Qt