MingW OpenGL compilation

I’ve got the linux-based gcc cross-compiler compiling regular SDL code
for Windows. It all works really well and I can compile Windows
binaries under Linux.

I’ve recently written some code that uses OpenGL. Is it possible to
cross-compile this stuff for Windows too? And what would I need to
download? (that’s hardware-accelerated OpenGL, not software).–
I will not spank others

PGP Fingerprint [6AD6 865A BF6E 76BB 1FC2 E4C4 DEEA 7D08 D511 E149]
PGP Public key [www.piku.org.uk/public-key.asc] - Home [www.piku.org.uk]

I had to do this for a Java port of SDL called SDL4Java (the homepage on
Sourceforge is not complete yet). Go to get the library and the header
files for Windows here:

http://www.opengl.org/users/downloads/index.html

The DLLs are only OpenGL v1.1. Your graphics card should have supplied
better ones.

Heres from the SDL4Java MinGW32 docs:----------------------------------------------
If you dont have the Microsoft library files you should still have the
DLLs. Two different tools can create
a def file from a dll: pexports and impdef.

Using pexports:

pexports opengl32.dll > opengl32.def
pexports glu32.dll > glu32.def

Using impdef:

echo ‘LIBRARY OPENGL32.dll’ > opengl32.def
impdef opengl32.dll >> opengl32.def
echo ‘LIBRARY GLU32.dll’ > glu32.def
impdef glu32.dll >> glu32.def

Creating the link library from a def you simply use dlltool like such:

dlltool --dllname opengl32.dll --def opengl32.def --output-lib libgl.a -k
dlltool --dllname glu32.dll --def glu32.def --output-lib libglu.a -k

James wrote:

I’ve got the linux-based gcc cross-compiler compiling regular SDL code
for Windows. It all works really well and I can compile Windows
binaries under Linux.

I’ve recently written some code that uses OpenGL. Is it possible to
cross-compile this stuff for Windows too? And what would I need to
download? (that’s hardware-accelerated OpenGL, not software).

I left this important note out by accident:--------------------------------------------
I had linking issues where the exported symbols argument sizes ( the '@'
and some number ) were incorrect. To fix this, I
had to hand edit the def files. You will probably have to do this also.

If you want I can save you some time and just send you the link
libraries or the edited def files.

James wrote:

I’ve got the linux-based gcc cross-compiler compiling regular SDL code
for Windows. It all works really well and I can compile Windows
binaries under Linux.

I’ve recently written some code that uses OpenGL. Is it possible to
cross-compile this stuff for Windows too? And what would I need to
download? (that’s hardware-accelerated OpenGL, not software).