Compiling Ocaml, SDL and OpenGL on Windows (mini tutorial)
January 7th, 2008One of two ways to get OpenGL into Ocaml is by using GLCaml binding. It is up to date and alive. GLCaml also includes so called compact drop-in binding for SDL SDLCaml. I am not much of a low level guy so I had real trouble figuring out how to compile the thing on windows and almost gave up. But the author replied to my mail and gave me few crucial hints which made it all work.

Here is what to do:
- Download and install Ocaml for windows (the MingW version)
- Install MingW. Install at least the C package, but NOT make.
- Install MSys (also from MingW site) which also installs its own make.
- Install the SDL library for mingw. Unzip and copy it to appropriate folders in mingw or make sure mingw can find it.
- Unzip glcaml.zip somewhere, and go to that location with MSys shell. When you are there run make in MSys.
- All examples should compile (the binding has many SDL and OpenGL) examples.
Thanks to Elliot for making the binding and replying to my mail. I hope I will dig Ocaml and make something concrete with it and this binding. Here is some more info and screens GLCaml and SDLCaml.
Enjoy the camel ride!

January 10th, 2008 at 3:32 pm
I intend to learn Ocaml and Haskell too. I started with haskell. I am currently experimenting with HOpenGL. Do you intend to make any more tutorials?
January 13th, 2008 at 1:56 am
Very nice! I’ll be adding some GLCaml examples using GLSL shaders to our site ASAP…
January 13th, 2008 at 12:29 pm
Great! As I said in python post comments, examples on your website were really interesting (they show various very interesting things one can do in ocaml (renderer, physics, sudoku) and they were main to inspire me to start tackling with OCaml.