Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2005-08-02 (12:38)
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 ( (e.g.
b) SDL for MingW (precompiled:
c) SDL image (source:, 
the precompiled version for VC6 works for MingW as well:
d) SDL ttf (source:, 
e) SDL mixer 

(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;) ...)