Tutoriel d'installation de Qt sur tablette Nokia n770
Installation
La version à installer pour un fonctionnement correct est la suivante :
Qt X11 opensource 4.1.5.
./configure -prefix /opt/Qt415
make
Si vous obtenez l'erreur suivante :
kernel/qapplication_x11.cpp: In function `void qt_init(QApplicationPrivate*, int, Display*, Qt::HANDLE, Qt::HANDLE)’:
kernel/qapplication_x11.cpp:1520: error: no matching function for call to `getXDefault(const char[4], const char[6], qreal*)’
kernel/qapplication_x11.cpp:1148: note: candidates are: void getXDefault(const char*, const char*, int*)
kernel/qapplication_x11.cpp:1159: note: void getXDefault(const char*, const char*, double*)
kernel/qapplication_x11.cpp:1170: note: void getXDefault(const char*, const char*, bool*)
Ce problème peut être corrigé par un simple “cast” dans le fichier “src/gui/kernel/qapplication_x11.cpp”. Le fichier corrigé peut être téléchargé ici :
qapplication_x11.cpp.
On relance alors le make :
make
Si vous rencontrez une nouvelle erreur :
painting/qpaintengine_x11.cpp: In function `void qt_tesselate_polygon(QVector*, const QPointF*, int, bool, QRect*)’:
painting/qpaintengine_x11.cpp:367: error: no matching function for call to `qMin(qreal&, XDouble)’
painting/qpaintengine_x11.cpp:368: error: no matching function for call to `qMax(qreal&, XDouble)’
Il ne connait pas les fonctions QMin() et QMax()… On a alors créé 2 inline tout bêtes pour parer à ça (faut dire que trouver le min ou la max de 2 nombres reste encore dans nos cordes) dans le fichier “src/gui/painting/qmath_p.h” Le fichier corrigé peut être téléchargé ici :
qmath_p.h.
On relance le make puis make install :
make
make install
Tests
On utilisera le fichier de test
hello.cpp.
On execute les commandes suivantes dans le dossier où se trouve le fichier de test "hello.cpp" :
/opt/Qt415/bin/qmake -project
/opt/Qt415/bin/qmake
On modifie le Makefile pour remplacer toutes les librairies version “debug” par celle sans “debug”. Puis on lance le make :
make
On transfert maintenant les librairies et notre programme de test (
hello.cpp). Il faut également modifier le fichier “/etc.ld.so.conf” afin de rajouter “/opt/Qt415/lib” puis exécuter la commande “ldconfig”.
./test
Et cela fonctionne !
Site mis à jour le : 21/09/2017 -
Me contacter