First at all: Sorry for my bad english.
In the configure script you are using the following code to test "The OpenGL Extension Wrangler Library"
Code:
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
int main(void) { glewInit(); return 0; }
I compiled that code successfully, but always get a segfault when I start the created binary.
I asked a friend to do the same on his machine, but there was all fine.
So I was using gdb:
Code:
gdb ./a.out
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run
Starting program: /tmp/raydium/raydium-2008-09-28/a.out
[Thread debugging using libthread_db enabled]
[New Thread 0xb7ae2930 (LWP 9948)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7ae2930 (LWP 9948)]
0xb80524f6 in glGetString () from //usr//lib/opengl/xorg-x11/lib/libGL.so.1
(gdb) bt
#0 0xb80524f6 in glGetString () from //usr//lib/opengl/xorg-x11/lib/libGL.so.1
#1 0xb7f6e7d3 in glewInit () from /usr/lib/libGLEW.so.1.5
#2 0x080484fa in main () at test.c:4
(gdb)
I thought it could be a problem with my driver/opengl implementation (mesa + r300), but "glewinfo" works fine.
So I spent a little time to read a few things.
When you have a look at
http://glew.sourceforge.net/basic.html you will see how the right initialization should be done.
Quote:
First you need to create a valid OpenGL rendering context and call glewInit() to initialize the extension entry points.
So, when I use the example code there and call
Code:
glutInit(&argc, argv);
glutCreateWindow("GLEW Test");
before "glewInit()" all is fine.
Can you proof that?
When the developer of the glew library say that the correct initialization is this way, perhaps you should change it.
"./raydium/init.c" should then also be changed.
Perhaps I am wrong - then explain me where is the mistake...