Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: ocamlsdl natively for Windows?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Tobias Elze <mailinglists@t...>
Subject: Re: ocamlsdl natively for Windows?

I succeeded in compiling them with MingW. Special thanks to Sami Mäkelä 
for his invaluable help and suggestions!

In order to spare others hours of annoying work I provide a mini Howto here:




How to compile ocamlsdl for MingW
=================================


1) Download the following archives:

a) ocamlsdl (http://ocamlsdl.sourceforge.net/download.html). (e.g. 
ocamlsdl-0.7.2.zip)
b) SDL for MingW (precompiled: 
http://www.libsdl.org/release/SDL-devel-1.2.8-mingw32.tar.gz)
c) SDL image (source: 
http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.4.zip, 
the precompiled version for VC6 works for MingW as well: 
http://www.libsdl.org/projects/SDL_image/release/SDL_image-devel-1.2.4-VC6.zip)
d) SDL ttf (source: 
http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.7.zip, 
precompiled: 
http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-devel-2.0.7-VC6.zip)
e) SDL mixer 
(http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.6.zip. 
precompiled: 
http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-devel-1.2.6-VC6.zip)

(If you need GL support, you may want to download lablgl as well. It has 
to be installed before compiling ocamlsdl!)


2) Install SDL

a) SDL main package

If you downloaded the compiled version for MingW (see above) then unpack 
it to your Cygwin home directory.

- go to cygwin/usr/include/Sdl, edit the file "SDL_main.h", and remove 
the line "#define main ...".
- look for a file named "i386-mingw32msvc-sdl-config" in your /bin 
directory and rename it to "sdl-config".
- edit this file,
	- change the prefix to "/usr",
	- remove all references to SDL_main and SDLmain
	- add "-mno-cygwin"  to "--cflags)"
	- remove all "-lmingw32" flags

b) SDL image, SDL ttf, SDL mixer

- If you use the precompiled packages, just unarchive. I put the *.h 
files into the directory where SDL.h was located and the libraries into 
the directory where the SDL libraries were.

3) Install ocamlsdl

- just ./configure, make, make install -- that's all!


(However, there is no visible standard output of the generated binaries 
-- I don't know if it's a bug or a feature;) ...)