<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/01/a8e2aeb057222710dd188876f1b96cc8"
  from="John Whitington &lt;john@c...&gt;"
  author="John Whitington"
  date="2009-01-22T15:21:42"
  subject="Re: Building with OCamlMkLib"
  prev="2009/01/3597c0d55acb8b0cfc394f624453ba49"
  next="2009/01/db46a675f250b0d4cc8af31992f1dc4a"
  prev-in-thread="2009/01/2a7886bfc158bad05addcad2991a2059"
  prev-thread="2009/01/9921cb683ab06368e880d42f5319d6ce"
  next-thread="2009/01/44166bc88a034e1581bc385cbd06574b"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Building with OCamlMkLib">
<msg 
  url="2009/01/fa6c4452c1d8f79eeb50fa71a9e2e430"
  from="John Whitington &lt;john@c...&gt;"
  author="John Whitington"
  date="2009-01-20T17:03:59"
  subject="Building with OCamlMkLib">
<msg 
  url="2009/01/8feeca3b384c260c274f1fff24d8962f"
  from="Alain Frisch &lt;alain@f...&gt;"
  author="Alain Frisch"
  date="2009-01-20T17:22:37"
  subject="Re: [Caml-list] Building with OCamlMkLib">
</msg>
<msg 
  url="2009/01/7b91d248f034cca644d2a27dd0959622"
  from="Matthieu Dubuget &lt;matthieu.dubuget@g...&gt;"
  author="Matthieu Dubuget"
  date="2009-01-20T21:35:49"
  subject="Re: [Caml-list] Building with OCamlMkLib">
</msg>
<msg 
  url="2009/01/2a7886bfc158bad05addcad2991a2059"
  from="Stefano Zacchiroli &lt;zack@u...&gt;"
  author="Stefano Zacchiroli"
  date="2009-01-21T14:43:29"
  subject="Re: [Caml-list] Building with OCamlMkLib">
</msg>
<msg 
  url="2009/01/a8e2aeb057222710dd188876f1b96cc8"
  from="John Whitington &lt;john@c...&gt;"
  author="John Whitington"
  date="2009-01-22T15:21:42"
  subject="Re: Building with OCamlMkLib">
</msg>
</msg>
</thread>

<contents>
Hi.

On 20 Jan 2009, at 17:03, John Whitington wrote:
&gt; I'm building a Plain C interface to our PDF libraries, but am stuck.  
&gt; The idea is to build a library with Ocamlmklib containing the C  
&gt; 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:

http://www.coherentpdf.com/solution.tar.bz2

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

ocamlc cpdflibc.mli
ocamlopt cpdflibc.ml
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

...to use the library.

With Thanks,

-- 
John Whitington
Coherent Graphics Ltd
http://www.coherentpdf.com/

</contents>

</message>

