<?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="2006/02/cc10da4a97264e6ce2e2036802b6fb15"
  from="Florent Monnier &lt;fmonnier@l...&gt;"
  author="Florent Monnier"
  date="2006-02-03T18:35:22"
  subject="Re: [Caml-list] Caml with main in C  + .cmxa"
  prev="2006/02/76caa78dff1e9412838a7f6e36883e86"
  next="2006/02/f7834e5f03c9c2ed81ae090ad7a53a08"
  prev-in-thread="2006/02/6ed6f081242c3173121ca4ea026de69f"
  prev-thread="2006/02/2641e29d70e30f3e6dee4ac20e939b0c"
  next-thread="2006/02/76caa78dff1e9412838a7f6e36883e86"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Caml with main in C  + .cmxa">
<msg 
  url="2006/02/6ed6f081242c3173121ca4ea026de69f"
  from="Florent Monnier &lt;fmonnier@l...&gt;"
  author="Florent Monnier"
  date="2006-02-03T15:04:52"
  subject="Caml with main in C  + .cmxa">
<msg 
  url="2006/02/cc10da4a97264e6ce2e2036802b6fb15"
  from="Florent Monnier &lt;fmonnier@l...&gt;"
  author="Florent Monnier"
  date="2006-02-03T18:35:22"
  subject="Re: [Caml-list] Caml with main in C  + .cmxa">
</msg>
</msg>
</thread>

<contents>
&gt; &gt; % ocamlopt -c  -I +libMagick  magick.cmxa   app.ml
&gt; &gt; % ocamlopt -output-obj -o mlobj.o unix.cmxa -I +libMagick magick.cmxa \
&gt; &gt;       app.cmx
&gt; &gt; (untill there, no error messages) 
&gt; &gt;
&gt; &gt; % gcc `Magick-config --cflags --cppflags`  main.c  -o myapp.opt  mlobj.o \
&gt; &gt;         -I'/usr/local/lib/ocaml' \
&gt; &gt;         -L/usr/local/lib/ocaml \
&gt; &gt;         -lunix -lasmrun  -lm -ldl \
&gt; &gt;         `Magick-config --ldflags --libs`
&gt; &gt;
&gt; &gt; and then with this last command, I get about 200 errors like this:
&gt; &gt; [...]

Indeed, the solution was to give the stubs of the binding to gcc:

% ls /usr/local/lib/ocaml/libMagick/
dllmagick_stubs.so  libmagick_stubs.a  magick.a  magick.cma  magick.cmi  
magick.cmxa  magick.mli

% gcc \
        `Magick-config --cflags --cppflags` \
        main.c  -o myapp.opt  mlobj.o \
        -I'/usr/local/lib/ocaml' \
        -L/usr/local/lib/ocaml \
        -lunix -lasmrun  -lm -ldl \
        `Magick-config --ldflags --libs` \
        -L/usr/local/lib/ocaml/libMagick  \
        -lmagick_stubs


++ Thanks a lot to Jonathan and Rabih for your help !

-- 

</contents>

</message>

