Pages : 1
#1 Le 09/04/2007, à 14:41
- elwario91
Gros problème OpenGL et SDL
Bonjour,
Je suis apprenti pour la programmation OpenGL et j'ai essayé de compiler un example du site du zéro mais je n'ai pas réussi!
J'ai installé les bibliothèques nécessaires mais je ne suis pas certain que j'utilise la bonne commande
g++ main.cpp -o -IGL -IGLU -ISDL
Et voici le résultat :
/tmp/ccCaJ24r.o: In function `dessinerPyramide()':
main.cpp:(.text+0x17): undefined reference to `glBindTexture'
main.cpp:(.text+0x1c): undefined reference to `glPushMatrix'
main.cpp:(.text+0x3a): undefined reference to `glTranslated'
main.cpp:(.text+0x5a): undefined reference to `glRotated'
main.cpp:(.text+0x72): undefined reference to `glBegin'
main.cpp:(.text+0x82): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x9c): undefined reference to `glVertex3d'
main.cpp:(.text+0xac): undefined reference to `glTexCoord2d'
main.cpp:(.text+0xca): undefined reference to `glVertex3d'
main.cpp:(.text+0xde): undefined reference to `glTexCoord2d'
main.cpp:(.text+0xf4): undefined reference to `glVertex3d'
main.cpp:(.text+0xf9): undefined reference to `glEnd'
main.cpp:(.text+0x119): undefined reference to `glRotated'
main.cpp:(.text+0x12c): undefined reference to `glPopMatrix'
/tmp/ccCaJ24r.o: In function `dessinerCaisse()':
main.cpp:(.text+0x149): undefined reference to `glBindTexture'
main.cpp:(.text+0x14e): undefined reference to `glPushMatrix'
main.cpp:(.text+0x16c): undefined reference to `glTranslated'
main.cpp:(.text+0x181): undefined reference to `glBindTexture'
main.cpp:(.text+0x199): undefined reference to `glBegin'
main.cpp:(.text+0x1a9): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x1bf): undefined reference to `glVertex3d'
main.cpp:(.text+0x1cf): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x1e9): undefined reference to `glVertex3d'
main.cpp:(.text+0x1f9): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x217): undefined reference to `glVertex3d'
main.cpp:(.text+0x227): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x241): undefined reference to `glVertex3d'
main.cpp:(.text+0x246): undefined reference to `glEnd'
main.cpp:(.text+0x266): undefined reference to `glRotated'
main.cpp:(.text+0x280): undefined reference to `glBegin'
main.cpp:(.text+0x290): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x2aa): undefined reference to `glVertex3d'
main.cpp:(.text+0x2ba): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x2d0): undefined reference to `glVertex3d'
main.cpp:(.text+0x2e0): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x2fa): undefined reference to `glVertex3d'
main.cpp:(.text+0x30a): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x328): undefined reference to `glVertex3d'
main.cpp:(.text+0x32d): undefined reference to `glEnd'
main.cpp:(.text+0x332): undefined reference to `glPopMatrix'
/tmp/ccCaJ24r.o: In function `DrawGL()':
main.cpp:(.text+0x346): undefined reference to `glClear'
main.cpp:(.text+0x352): undefined reference to `glMatrixMode'
main.cpp:(.text+0x357): undefined reference to `glLoadIdentity'
main.cpp:(.text+0x39d): undefined reference to `gluLookAt'
main.cpp:(.text+0x3bd): undefined reference to `glRotated'
main.cpp:(.text+0x3d2): undefined reference to `glBindTexture'
main.cpp:(.text+0x3de): undefined reference to `glBegin'
main.cpp:(.text+0x3fa): undefined reference to `glColor3ub'
main.cpp:(.text+0x40e): undefined reference to `glTexCoord2i'
main.cpp:(.text+0x42a): undefined reference to `glVertex3i'
main.cpp:(.text+0x446): undefined reference to `glColor3ub'
main.cpp:(.text+0x45a): undefined reference to `glTexCoord2i'
main.cpp:(.text+0x476): undefined reference to `glVertex3i'
main.cpp:(.text+0x492): undefined reference to `glColor3ub'
main.cpp:(.text+0x4a6): undefined reference to `glTexCoord2i'
main.cpp:(.text+0x4c2): undefined reference to `glVertex3i'
main.cpp:(.text+0x4de): undefined reference to `glColor3ub'
main.cpp:(.text+0x4f2): undefined reference to `glTexCoord2i'
main.cpp:(.text+0x50e): undefined reference to `glVertex3i'
main.cpp:(.text+0x513): undefined reference to `glEnd'
main.cpp:(.text+0x52f): undefined reference to `glColor3ub'
main.cpp:(.text+0x53e): undefined reference to `glFlush'
main.cpp:(.text+0x543): undefined reference to `SDL_GL_SwapBuffers'
/tmp/ccCaJ24r.o: In function `main':
main.cpp:(.text+0x571): undefined reference to `SDL_Init'
main.cpp:(.text+0x578): undefined reference to `SDL_Quit'
main.cpp:(.text+0x591): undefined reference to `SDL_WM_SetCaption'
main.cpp:(.text+0x5b5): undefined reference to `SDL_SetVideoMode'
main.cpp:(.text+0x5c4): undefined reference to `glMatrixMode'
main.cpp:(.text+0x5c9): undefined reference to `glLoadIdentity'
main.cpp:(.text+0x5f1): undefined reference to `gluPerspective'
main.cpp:(.text+0x5fd): undefined reference to `glEnable'
main.cpp:(.text+0x609): undefined reference to `glEnable'
main.cpp:(.text+0x61d): undefined reference to `loadTexture(char const*, bool)'
main.cpp:(.text+0x636): undefined reference to `loadTexture(char const*, bool)'
main.cpp:(.text+0x64f): undefined reference to `loadTexture(char const*, bool)'
main.cpp:(.text+0x668): undefined reference to `loadTexture(char const*, bool)'
main.cpp:(.text+0x672): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x67c): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x6bb): undefined reference to `takeScreenshot(char const*)'
main.cpp:(.text+0x6c6): undefined reference to `SDL_PollEvent'
main.cpp:(.text+0x6d4): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x7c1): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x7f0): undefined reference to `SDL_Delay'
collect2: ld a retourné 1 code d'état d'exécution
warren@warren-desktop:~/Desktop/sdlgl_06_textures.zip_FILES$ g++ main.cpp -o -IGL -IGLU -ISDL
/tmp/ccIPfxdv.o: In function `dessinerPyramide()':
main.cpp:(.text+0x17): undefined reference to `glBindTexture'
main.cpp:(.text+0x1c): undefined reference to `glPushMatrix'
main.cpp:(.text+0x3a): undefined reference to `glTranslated'
main.cpp:(.text+0x5a): undefined reference to `glRotated'
main.cpp:(.text+0x72): undefined reference to `glBegin'
main.cpp:(.text+0x82): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x9c): undefined reference to `glVertex3d'
main.cpp:(.text+0xac): undefined reference to `glTexCoord2d'
main.cpp:(.text+0xca): undefined reference to `glVertex3d'
main.cpp:(.text+0xde): undefined reference to `glTexCoord2d'
main.cpp:(.text+0xf4): undefined reference to `glVertex3d'
main.cpp:(.text+0xf9): undefined reference to `glEnd'
main.cpp:(.text+0x119): undefined reference to `glRotated'
main.cpp:(.text+0x12c): undefined reference to `glPopMatrix'
/tmp/ccIPfxdv.o: In function `dessinerCaisse()':
main.cpp:(.text+0x149): undefined reference to `glBindTexture'
main.cpp:(.text+0x14e): undefined reference to `glPushMatrix'
main.cpp:(.text+0x16c): undefined reference to `glTranslated'
main.cpp:(.text+0x181): undefined reference to `glBindTexture'
main.cpp:(.text+0x199): undefined reference to `glBegin'
main.cpp:(.text+0x1a9): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x1bf): undefined reference to `glVertex3d'
main.cpp:(.text+0x1cf): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x1e9): undefined reference to `glVertex3d'
main.cpp:(.text+0x1f9): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x217): undefined reference to `glVertex3d'
main.cpp:(.text+0x227): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x241): undefined reference to `glVertex3d'
main.cpp:(.text+0x246): undefined reference to `glEnd'
main.cpp:(.text+0x266): undefined reference to `glRotated'
main.cpp:(.text+0x280): undefined reference to `glBegin'
main.cpp:(.text+0x290): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x2aa): undefined reference to `glVertex3d'
main.cpp:(.text+0x2ba): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x2d0): undefined reference to `glVertex3d'
main.cpp:(.text+0x2e0): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x2fa): undefined reference to `glVertex3d'
main.cpp:(.text+0x30a): undefined reference to `glTexCoord2d'
main.cpp:(.text+0x328): undefined reference to `glVertex3d'
main.cpp:(.text+0x32d): undefined reference to `glEnd'
main.cpp:(.text+0x332): undefined reference to `glPopMatrix'
/tmp/ccIPfxdv.o: In function `DrawGL()':
main.cpp:(.text+0x346): undefined reference to `glClear'
main.cpp:(.text+0x352): undefined reference to `glMatrixMode'
main.cpp:(.text+0x357): undefined reference to `glLoadIdentity'
main.cpp:(.text+0x39d): undefined reference to `gluLookAt'
main.cpp:(.text+0x3bd): undefined reference to `glRotated'
main.cpp:(.text+0x3d2): undefined reference to `glBindTexture'
main.cpp:(.text+0x3de): undefined reference to `glBegin'
main.cpp:(.text+0x3fa): undefined reference to `glColor3ub'
main.cpp:(.text+0x40e): undefined reference to `glTexCoord2i'
main.cpp:(.text+0x42a): undefined reference to `glVertex3i'
main.cpp:(.text+0x446): undefined reference to `glColor3ub'
main.cpp:(.text+0x45a): undefined reference to `glTexCoord2i'
main.cpp:(.text+0x476): undefined reference to `glVertex3i'
main.cpp:(.text+0x492): undefined reference to `glColor3ub'
main.cpp:(.text+0x4a6): undefined reference to `glTexCoord2i'
main.cpp:(.text+0x4c2): undefined reference to `glVertex3i'
main.cpp:(.text+0x4de): undefined reference to `glColor3ub'
main.cpp:(.text+0x4f2): undefined reference to `glTexCoord2i'
main.cpp:(.text+0x50e): undefined reference to `glVertex3i'
main.cpp:(.text+0x513): undefined reference to `glEnd'
main.cpp:(.text+0x52f): undefined reference to `glColor3ub'
main.cpp:(.text+0x53e): undefined reference to `glFlush'
main.cpp:(.text+0x543): undefined reference to `SDL_GL_SwapBuffers'
/tmp/ccIPfxdv.o: In function `main':
main.cpp:(.text+0x571): undefined reference to `SDL_Init'
main.cpp:(.text+0x578): undefined reference to `SDL_Quit'
main.cpp:(.text+0x591): undefined reference to `SDL_WM_SetCaption'
main.cpp:(.text+0x5b5): undefined reference to `SDL_SetVideoMode'
main.cpp:(.text+0x5c4): undefined reference to `glMatrixMode'
main.cpp:(.text+0x5c9): undefined reference to `glLoadIdentity'
main.cpp:(.text+0x5f1): undefined reference to `gluPerspective'
main.cpp:(.text+0x5fd): undefined reference to `glEnable'
main.cpp:(.text+0x609): undefined reference to `glEnable'
main.cpp:(.text+0x61d): undefined reference to `loadTexture(char const*, bool)'
main.cpp:(.text+0x636): undefined reference to `loadTexture(char const*, bool)'
main.cpp:(.text+0x64f): undefined reference to `loadTexture(char const*, bool)'
main.cpp:(.text+0x668): undefined reference to `loadTexture(char const*, bool)'
main.cpp:(.text+0x672): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x67c): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x6bb): undefined reference to `takeScreenshot(char const*)'
main.cpp:(.text+0x6c6): undefined reference to `SDL_PollEvent'
main.cpp:(.text+0x6d4): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x7c1): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x7f0): undefined reference to `SDL_Delay'
collect2: ld a retourné 1 code d'état d'exécution
Pouvez-vous m'aider?
Merci
Hors ligne
#2 Le 09/04/2007, à 15:02
- Vegetable
Re : Gros problème OpenGL et SDL
Bonjour, n'utilise pas -I mais -l pour linker une librairie!
Essaie de compiler avec
g++ main.cpp -o programme -lGL -lGLU -lSDL
.
Dernière modification par Vegetable (Le 09/04/2007, à 15:04)
Hors ligne
#3 Le 09/04/2007, à 15:23
- elwario91
Re : Gros problème OpenGL et SDL
Salut,
Merci pour ta réponse,
j'ai essayé 2 code, un avec des textures, et un simple avec un dégardé et j'ai fait un récapitulatif : http://pastebin.ca/431165
Merci d'avance
Hors ligne
#4 Le 09/04/2007, à 15:50
- Vegetable
Re : Gros problème OpenGL et SDL
Tu as oublié d'implémenter les fonctions loadTexture et takeScreenshot.
Ajoute-les dans ton code et ça devrait compiler.
Hors ligne
Pages : 1