Testdyngl problem under windows

Hi,

Has anyone ever encountered problems with testdyngl under windows ?

Using cross compilation, I can produce a testdyngl.exe that works fine
on the target machine (this machine is not mine), but if it is locally
compiled, testdyngl.exe segfaults on startup, and the same binary
segfaults on other machines. That happens both with MinGW-3.1.0-1 and
with latest mingw packages.

The person having trouble can compile and run testgl and other SDL
programs fine.

testdyngl.exe is compiled as follows :
gcc -I/mingw/SDL/include -L/mingw/SDL/lib -o testdyngl.exe testdyngl.c
-lmingw32 -lSDLmain -lSDL -DHAVE_OPENGL

The machine is a P4 1.8, AGP4x, Radeon 9800 Pro 128MB.
The video drivers are the ATI Catalyst 4.6
From the testgl output :
Vendor : ATI Technologies Inc.
Renderer : RADEON 9800 Pro x86/SSE2
Version : 1.5.4391 WinXP Release

Any suggestions ? It seems that all the function pointers returned by
SDL_GL_GetProcAddress are non NULL but wrong (even for functions as
simple as glIsTexture or glOrtho…) and this causes crashing.

Stephane

Are you statically linking when your cross compile?On Jul 27, 2004, at 6:43 PM, Stephane Marchesin wrote:

Hi,

Has anyone ever encountered problems with testdyngl under windows ?

Using cross compilation, I can produce a testdyngl.exe that works fine
on the target machine (this machine is not mine), but if it is locally
compiled, testdyngl.exe segfaults on startup, and the same binary
segfaults on other machines. That happens both with MinGW-3.1.0-1 and
with latest mingw packages.

The person having trouble can compile and run testgl and other SDL
programs fine.

testdyngl.exe is compiled as follows :
gcc -I/mingw/SDL/include -L/mingw/SDL/lib -o testdyngl.exe testdyngl.c
-lmingw32 -lSDLmain -lSDL -DHAVE_OPENGL

The machine is a P4 1.8, AGP4x, Radeon 9800 Pro 128MB.
The video drivers are the ATI Catalyst 4.6
From the testgl output :
Vendor : ATI Technologies Inc.
Renderer : RADEON 9800 Pro x86/SSE2
Version : 1.5.4391 WinXP Release

Any suggestions ? It seems that all the function pointers returned by
SDL_GL_GetProcAddress are non NULL but wrong (even for functions as
simple as glIsTexture or glOrtho…) and this causes crashing.

Stephane


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

  • Donny Viszneki

Donny Viszneki wrote:

Are you statically linking when your cross compile?

No, I’m using the standard build procedure with [path to sdl-config for
mingw]/sdl-config --libs --cflags

Stephane

The reason for the crash/segfault is because the
function pointers don’t use the same calling
convention. Just place APIENTRY infront of the
function pointers in the glfuncs declaration, and
it’ll work OK.

e.g Instead of void(glBegin)(GLenum);, use
void(APIENTRY
glBegin)(GLenum);

— Stephane Marchesin <stephane.marchesin at wanadoo.fr>
wrote:> Donny Viszneki wrote:

Are you statically linking when your cross
compile?

No, I’m using the standard build procedure with
[path to sdl-config for
mingw]/sdl-config --libs --cflags

Stephane


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

Damien A wrote:

The reason for the crash/segfault is because the
function pointers don’t use the same calling
convention. Just place APIENTRY infront of the
function pointers in the glfuncs declaration, and
it’ll work OK.

e.g Instead of void(glBegin)(GLenum);, use
void(APIENTRY
glBegin)(GLenum);

Yes but… that APIENTRY thing is already there, since we use
testdyngl.c from the SDL cvs.

If you want to see the full thread about this problem, it’s there :
http://sourceforge.net/mailarchive/forum.php?forum_id=40961
It’s called “[patch] OpenGL video code”, but it has quite a lot of posts
(some of these having nothing to do with this problem), that’s why I was
trying to summarize the information here.

Stephane

Damien A wrote:

The reason for the crash/segfault is because the
function pointers don’t use the same calling
convention. Just place APIENTRY infront of the
function pointers in the glfuncs declaration, and
it’ll work OK.

e.g Instead of void(glBegin)(GLenum);, use
void(APIENTRY
glBegin)(GLenum);

Ok, it seems you were right :slight_smile:
There was amisunderstanding between me and Ulrich, and I though he was
using a fixed testdyngl.c, while he was using the one from SDL 1.2.7,
which is not fixed.

Anyway, this problem is solved now, sorry for the noise.

Thanks,
Stephane