Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Building with OCamlMkLib
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-01-22 (15:21)
From: John Whitington <john@c...>
Subject: Re: Building with OCamlMkLib

On 20 Jan 2009, at 17:03, John Whitington wrote:
> I'm building a Plain C interface to our PDF libraries, but am stuck.  
> The idea is to build a library with Ocamlmklib containing the C  
> wrapper around the ocaml code.

Thanks to those who helped me here - I finally settled on a modified  
version of what's given in 18.8 in the manual.

Here are the new files:

And here's what we ended up with...

ocamlc cpdflibc.mli
ocamlc cpdflibwrapper.c
ocamlopt -output-obj -o cpdflibc.o cpdflibc.cmx
cp /usr/local/lib/ocaml/libasmrun.a cpdflib.a
ar r cpdflib.a cpdflibc.o cpdflibwrapper.o

...producing the final cpdflib.a with which we can do...

cc -o test test.c cpdflib.a use the library.

With Thanks,

John Whitington
Coherent Graphics Ltd