Skip to content

Install on windows (vc++)

JoeDralliam edited this page Apr 30, 2012 · 3 revisions

Install on windows (vc++)

Install the SFML (>= 2.0)

You must first compile and install the sfml from sources (see this tutorial).

You may as well download binaries from this page.

Dependencies

Ocsfml requires several tools and library in order to be built:

Open a Windows Command Prompt and enter the following command:

set PFPATH=C:\Program Files

If you are compiling on the 64-bit version of Windows 7, enter the following instead:

set PFPATH=C:\Program Files (x86)

Then enter the following commands:

cd "%PFPATH%\Microsoft Visual Studio 10.0\VC\bin"

set FLEXDLLDIR=%PFPATH%\flexdll

vcvars32

echo VCPATH="cygpath -p '%Path%'" >C:\cygwin\tmp\msenv

echo LIB="%LIB%;C:\Tcl\lib" >>C:\cygwin\tmp\msenv

echo LIBPATH="%LIBPATH%" >>C:\cygwin\tmp\msenv

echo INCLUDE="%INCLUDE%;%FLEXDLLDIR%;C:\Tcl\include" >>C:\cygwin\tmp\msenv

echo FLPATH="cygpath '%FLEXDLLDIR%'" >>C:\cygwin\tmp\msenv

echo PATH="$VCPATH:$FLPATH:$PATH" >>C:\cygwin\tmp\msenv

echo export PATH LIB LIBPATH INCLUDE >>C:\cygwin\tmp\msenv

echo export OCAMLBUILD_FIND=/usr/bin/find >>C:\cygwin\tmp\msenv

Open a Cygwin shell and enter the following commands:

tr -d '\r' </tmp/msenv >.msenv32

echo '. $HOME/.msenv32' >>.bashrc

Building ocsfml

You need to obtain the sources. In a git bash, navigates to the directory where you want to download them, and type: git clone git://github.com/JoeDralliam/Ocsfml.git Ocsfml

cd Ocsfml

mkdir build

cd build

Open a cygwin shell, and navigate to Ocsfml/build. To configure ocsfml, you must invoke cmake. If some of the ocsfml dependencies are in exotic directories, pass the -i argument to cmake, change what you need to, and leave the rest unchanged. Thus type :

cmake .. or cmake -i ..

You may as well use cmake-gui, invoking it from the shell.

Finally, build and install ocsfml (this stage may take a few minutes) :

nmake && nmake install

Testing the installation

You are almost done ! As ocsfml is still unstable, I highly reccommend you to build the tests, to make sure it was correctly installed. Type (in the build directory):

nmake tests && nmake install_tests