How to fix the Unbound module Graphics in an ocaml project

Image
From ~/pr/gitl/ocaml-gol In a constant effort to learn new programming languages, I'm currently trying to use ocaml , a free and open-source general-purpose, multi-paradigm programming language maintained at the Inria . It's basically an extension of Caml with object-oriented features. I'm mostly interested by its functionnal and pattern matching features but the module part of the language can be a bit difficult to understand for someone with little to none ML (Meta Language) background.   The error When trying to use the graphics module to create a graphical window and go just a little further than the simplest helloworld program, here is the result : If the project uses dune : (executable (name ocaml_project) (libraries lwt.unix graphics) ) with this code : let () = Printf.printf "Hello, world!\n";; Lwt_io.printf "Hello, world!\n";; Graphics.open_graph " 800x600";; The first times I built this project running the du

Building openmw on Debian Jessie

openmw is an open source project rewritting Morrowind's engine, you'll need the original game to play. It's difficult to build openmw on Debian because we can't find all dependencies in official apt-get repositories. Here is my solution.

I'll not list all depndencies needed to manually build openmw, many of these libraries (Qt4,...) can be found using official packages manager (aptitude, synaptic). But some libraries can't be found.

FFmpeg

There is an issue with this library : even if the provided version with debian could work, the libswresample component is only available  in sid. But I found a suitable version in deb-multimedia repositories. Edit the /etc/apt/sources.list file and add this line :

deb http://www.deb-multimedia.org jessie main non-free

then run apt-get update and apt-get install libswresample-dev.

OpenSceneGraph

openmw needs version 3.3.4 while apt-get repositories only have 3.2.1, so we have to build it from sources. You'll have to grab the code from the official OSG website.

This project uses cmake so you just have to issue these commands:

mkdir build
cd build/
cmake ..
make
sudo make install

For a better tracking of manual instalations you can replace the last line with sudo checkinstall make install.

It seems cmake isn't able to find osg libraries, even after make install. So I need to teel cmake where to find the osg libraries :

OSG_ROOT=/usr/local/lib64 cmake ..

Bullet

openmw needs libbullet v2.83, unfortunately, debian has v0.82, so you have to install it manually. You can download sources from github repository and use the same commands as for osg. But as for osg, we need to tell cmake wher to find this library :

Final build

Now, come back to the openmw project, create and go in a build sub-directory and run the configuration process:

OSG_ROOT=/usr/local/lib64 BULLET_ROOT=/usr/local/lib64 cmake ..

cmake should find all needed components and you can build it with the make command.

Comments

Popular posts from this blog

How to make a map of variant in C++