Bonjour.

J'essaie de compiler des fichier .cpp qui a la libraire glut.h d'incluse
(#include <Gl/glut.h>)

le problème lorsque je compile est que j'ai pas mal d'erreur (bien qu'ayant réussi à en réduire le nombre affiché) du type undefinied reference to glut...
Uniquement des méthode de glut.

voici ma ligne de commande poiur la compilation :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
g++ -Wno-deprecated -lGL -lfl -lc -o grapher graphic.cpp grapher.cpp

et voici les erreurs que j'obtient :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
In file included from grapher.cpp:11:
y.tab.c: In function «int yyparse()»:
y.tab.c:1552: attention : deprecated conversion from string constant to «char*»
y.tab.c:1698: attention : deprecated conversion from string constant to «char*»
/tmp/ccvNwlya.o: In function `main':
grapher.cpp:(.text+0x33ac): multiple definition of `main'
/usr/lib/libfl_pic.a(libfl_pic_a-libmain.o):/build/buildd/flex-2.5.34/libmain.c:29: first defined here
/usr/lib/libfl_pic.a(libfl_pic_a-libmain.o): In function `main':
libmain.c:(.text+0x21): undefined reference to `yylex'
/tmp/ccwuxeL3.o: In function `reshape(int, int)':
graphic.cpp:(.text+0x2f5): undefined reference to `glutPostRedisplay'
/tmp/ccwuxeL3.o: In function `idle()':
graphic.cpp:(.text+0x303): undefined reference to `glutPostRedisplay'
/tmp/ccwuxeL3.o: In function `clavier(unsigned char, int, int)':
graphic.cpp:(.text+0x32c): undefined reference to `glutPostRedisplay'
graphic.cpp:(.text+0x3c6): undefined reference to `glutPostRedisplay'
/tmp/ccwuxeL3.o: In function `mouse(int, int, int, int)':
graphic.cpp:(.text+0x416): undefined reference to `glutGet'
graphic.cpp:(.text+0x42d): undefined reference to `glutGet'
graphic.cpp:(.text+0x5d2): undefined reference to `glutPostRedisplay'
/tmp/ccwuxeL3.o: In function `affichage()':
graphic.cpp:(.text+0x68a): undefined reference to `glutSwapBuffers'
/tmp/ccwuxeL3.o: In function `init_graphic(int, char**)':
graphic.cpp:(.text+0x6ae): undefined reference to `glutInit'
graphic.cpp:(.text+0x6ba): undefined reference to `glutInitDisplayMode'
graphic.cpp:(.text+0x6ce): undefined reference to `glutInitWindowPosition'
graphic.cpp:(.text+0x6e5): undefined reference to `glutInitWindowSize'
graphic.cpp:(.text+0x6f1): undefined reference to `glutCreateWindow'
graphic.cpp:(.text+0x875): undefined reference to `glutDisplayFunc'
graphic.cpp:(.text+0x881): undefined reference to `glutKeyboardFunc'
graphic.cpp:(.text+0x88d): undefined reference to `glutMouseFunc'
graphic.cpp:(.text+0x899): undefined reference to `glutReshapeFunc'
graphic.cpp:(.text+0x8a5): undefined reference to `glutIdleFunc'
graphic.cpp:(.text+0x8aa): undefined reference to `glutMainLoop'
/tmp/ccvNwlya.o: In function `yyinput()':
grapher.cpp:(.text+0x213f): undefined reference to `yywrap'
/tmp/ccvNwlya.o: In function `yylex()':
grapher.cpp:(.text+0x2a4b): undefined reference to `yywrap
je ne vois pas d'ou viens le problème. Peut-etre une libraire manquante ou autre ?

Merci