Pb segmentation fault avec glutinit()
Bjr,
Soit le prog suivant:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| #include <stdio.h>
#include <GL/gl.h>
#include <GL/glut.h>
int main(int *argc, char **argv) {
glutInit(argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE);
glutInitWindowSize(640, 480);
glutInitWindowPosition(50, 50);
glutCreateWindow("Essai_3");
//glutDisplayFunc(Display);
glutMainLoop();
return 0;
} |
compilé sans problèmes avec:
Code:
gcc hello.c -L/usr/lib -L/usr/X11R6/lib -L/usr/X11R6/lib -lX11 -lXi -lXext -lSM -lICE -lXmu -lglut -lGL -lGLU -lm
A l'exécution:
Segmentation fault au niveau de glutInit()
Pouvez-vous m'informer un peu plus sur ce problème énervant qu va me pousser à abandonner la prog OpenGL en GLUT ?
(je connais très bien l'utilisation de OpenGL puisque j'ai développé un visualisateur 3D en utilisant un composant)
Il est anormal que la libglut ne soit pas certifiée opérationnelle sur toutes les configurations, alors qu'il s'agit d'une lib de base qui devrait fonctionner partout ss pbs.
suite de mon message précédent: pg segmentation fault
Voici un examen du pb avec gdb:
Citation:
gdb a.out
GNU gdb 5.3-22mdk (Mandrake Linux)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-mandrake-linux-gnu"...
(gdb) run
Starting program: /home/grochat/sources_free_pascal/exo_opengl/a.out
Program received signal SIGSEGV, Segmentation fault.
0x40161975 in glutInit () from /usr/X11R6/lib/libglut.so.3
(gdb) where
#0 0x40161975 in glutInit () from /usr/X11R6/lib/libglut.so.3
#1 0xbffff898 in ?? ()
#2 0x402be7f7 in __libc_start_main () from /lib/i686/libc.so.6
(gdb)