[QT/OpenGL] Problème avec QGLWidget

Résolu/Fermé
azerty0 Messages postés 1274 Date d'inscription samedi 27 octobre 2007 Statut Membre Dernière intervention 5 septembre 2013 - 5 mai 2009 à 10:43
azerty0 Messages postés 1274 Date d'inscription samedi 27 octobre 2007 Statut Membre Dernière intervention 5 septembre 2013 - 5 mai 2009 à 14:28
Bonjour,

Je viens de récupérer les codes d'un amis, donc je vais avoir besoin.
Il ont été fait sur MAC, et je travaille aujourd'hui sur un Windows.

J'essaye donc de compiler ces codes avec l'invite de commandes QT :

>qmake -project
>qmake

// Problème ensuite avec :

>make

: 'make' n'est pas reconnu en trant que commande interne.......


J'ai donc trouvé la ligne : mingw32-make, qui semble marcher, mais il mesort tout un flot d'erreurs :

C:\Qt\2009.02\main>mingw32-make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Qt/2009.02/main'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\qt
\include\QtCore" -I"..\qt\include\QtGui" -I"..\qt\include" -I"." -I"." -I"..\qt\
include\ActiveQt" -I"debug" -I"." -I"..\qt\mkspecs\win32-g++" -o debug\GLWidget.
o GLWidget.cpp
GLWidget.cpp:11:20: QtOpenGL: No such file or directory
In file included from GLWidget.cpp:12:
GLWidget.h:14:21: QGLWidget: No such file or directory
In file included from GLWidget.cpp:12:
GLWidget.h:37: error: invalid use of undefined type `struct QGLWidget'
../qt/include/QtGui/../../src/gui/image/qpixmap.h:248: error: forward declaratio
n of `struct QGLWidget'
GLWidget.h:37: warning: `class GLWidget' has virtual functions but non-virtual d
estructor
GLWidget.cpp: In constructor `GLWidget::GLWidget(QWidget*)':
GLWidget.cpp:19: error: type `struct QGLWidget' is not a direct base of `GLWidge
t'
GLWidget.cpp:21: error: `makeCurrent' undeclared (first use this function)
GLWidget.cpp:21: error: (Each undeclared identifier is reported only once for ea
ch function it appears in.)
GLWidget.cpp:23: error: `setFixedSize' undeclared (first use this function)
GLWidget.cpp:48: error: `startTimer' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::paintGL()':
GLWidget.cpp:349: error: `swapBuffers' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::mouseMoveEvent(QMouseEvent*)':
GLWidget.cpp:541: error: `updateGL' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::processHits(GLint, GLuint*)':
GLWidget.cpp:560: error: no matching function for call to `QMessageBox::critical
(GLWidget* const, const char[17], const char[62])'
../qt/include/QtGui/../../src/gui/dialogs/qmessagebox.h:202: note: candidates ar
e: static QMessageBox::StandardButton QMessageBox::critical(QWidget*, const QStr
ing&, const QString&, QFlags<QMessageBox::StandardButton>, QMessageBox::Standard
Button)
../qt/include/QtGui/../../src/gui/dialogs/qmessagebox.h:262: note:
   static int QMessageBox::critical(QWidget*, const QString&, const QString&, in
t, int, int)
../qt/include/QtGui/../../src/gui/dialogs/qmessagebox.h:269: note:
   static int QMessageBox::critical(QWidget*, const QString&, const QString&, co
nst QString&, const QString&, const QString&, int, int)
../qt/include/QtGui/../../src/gui/dialogs/qmessagebox.h:273: note:
   static int QMessageBox::critical(QWidget*, const QString&, const QString&, QM
essageBox::StandardButton, QMessageBox::StandardButton)
GLWidget.cpp: In member function `void GLWidget::affichNumFace(unsigned int)':
GLWidget.cpp:595: error: `renderText' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::myPick(const QPoint&)':
GLWidget.cpp:646: error: `updateGL' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::drawingObject(bool)':
GLWidget.cpp:655: error: `updateGL' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::changeModeDraw(int)':
GLWidget.cpp:665: error: `updateGL' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::changeModeCouleur(int)':
GLWidget.cpp:677: error: `updateGL' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::changeModeSurbrillance(int)':
GLWidget.cpp:685: error: `updateGL' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::changeModeAffichNumFaces(int)':

GLWidget.cpp:691: error: `updateGL' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::timerEvent(QTimerEvent*)':
GLWidget.cpp:712: error: `updateGL' undeclared (first use this function)
GLWidget.cpp: In member function `GLuint GLWidget::loadTexture(QString, bool)':
GLWidget.cpp:723: error: incomplete type `QGLWidget' used in nested name specifi
er
GLWidget.cpp: In member function `void GLWidget::changeCamFixed(bool)':
GLWidget.cpp:750: error: `updateGL' undeclared (first use this function)
GLWidget.cpp: In member function `void GLWidget::keyPressEvent(QKeyEvent*)':
GLWidget.cpp:759: error: `updateGL' undeclared (first use this function)
mingw32-make[1]: *** [debug/GLWidget.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/2009.02/main'
mingw32-make: *** [debug] Error 2


J'en conclue qu'il y a donc un problème au niveau d'un include, mais je ne saurais trouvé lequel, et ce n'est pas faute d'avoir cherché...

Merci de votre aide précieuse,

Azerty
A voir également:

2 réponses

azerty0 Messages postés 1274 Date d'inscription samedi 27 octobre 2007 Statut Membre Dernière intervention 5 septembre 2013 75
5 mai 2009 à 14:28
Tout était présent, mais merci de ta réponse, je viens de trouver ma solution :

Dans le .pro généré, il faut rajouter

QT += opengl

Et cela a compilé
1