Je reçois le texte suivantavertissement: déclaration avant de 'GLUquadric struct'
x.cpp: In member function ‘X’:
x.cpp:153:10: warning: possible problem detected in invocation of delete operator:
x.cpp:146:19: warning: ‘quadric’ has incomplete type /usr/include/GL/glu.h:271:7: warning: forward declaration of ‘struct GLUquadric’
x.cpp:153:10: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
Avec ce code
146: GLUquadricObj * quadric;
147: quadric = gluNewQuadric();
148: gluQuadricNormals(quadric, GLU_SMOOTH);
149: gluQuadricTexture(quadric, GL_TRUE);
150:
151: gluSphere(quadric, object.radius(), slices, stacks);
152:
153: delete quadric;
Je comprends pourquoi il le fait, GLUquadricObj est en fait une déclaration foward, MAIS
Je souhaite éviter cet avertissement.
Je voudrais soit supprimer cet avertissement pour cette seule fonction.
Ou résoudre l'avertissement en incluant l'en-tête droit. J'ai utilisé grep dans/usr/include/GL et n'ai pas trouvé le type complet.
J'utilise Arch Linux
mesa 7.8.2-3
et
gcc 4.5.1-1
Thx, c'est la solution. – LabOctoCat