-
Notifications
You must be signed in to change notification settings - Fork 5
Install on windows (vc++)
You must first compile and install the sfml from sources (see this tutorial).
You may as well download binaries from this page.
Ocsfml requires several tools and library in order to be built:
-
boost
-
ocamlbuild
-
camlp4
-
cmake (>= 2.8): http://www.cmake.org/cmake/resources/software.html
-
findlib (>= 1.2.7): http://projects.camlcity.org/projects/findlib.html
-
Visual C++ (>= 10) : http://msdn.microsoft.com/en-us/vstudio/hh388567
-
bash : some ocaml tools (ocamlbuild, ...) can't work without bash. The easiest way to get a correctly configured (for ocsfml) bash is to install cygwin, and then follow these instructions (taken from this file) :
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
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
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