This page is intended to help you with verifying you can run applications that use the OCaml Graphics library on your computer. This is important because some of our assignments have components that will require use of this library in order to complete them.
First, create an Eclipse project for the graphics test:
GraphicsTestfor "project name" and click Finish.
GraphicsTestin the Package Explorer window, select Properties.
We have encountered issues in the past on Windows where the ocamlrun process spawned when a graphical application is launched is not stopped when the window is closed via the red X in the Windows interface. This can result in issues where Eclipse will refuse to re-compile any changes to your project. In order to fix this issue if your assignments are not compiling after being changed, you should use CTRL-ALT-DELETE to open the Task Manager, and kill all processes named ocamlrun. In general, our assignments will provide some means of exiting the program, either via a button in the program or via a button press - you should always use this method of exiting the application in order to avoid this issue.
In the past, students have had some issues with XQuartz/X11 and compiling OCaml Graphics on OS X. The most common error usually looks something like this:
Error: Error on dynamically loaded library:
/usr/local/lib/ocaml/stublibs/dllgraphics.so: dlopen(/usr/local/lib/ocaml/stublibs/dllgraphics.so, 138):
Library not loaded: /opt/local/lib/libX11.6.dylib
Referenced from: /usr/local/lib/ocaml/stublibs/dllgraphics.so
Reason: image not found
If that happens, see the instructions to install the X11 libraries, paying particular attention to the Mac issue with dynamic libraries.