From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 912F1BB81 for ; Fri, 3 Feb 2006 19:35:22 +0100 (CET) Received: from mail.libertysurf.net (mx-out.libertysurf.net [213.36.80.91]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k13IZKc5030165 for ; Fri, 3 Feb 2006 19:35:22 +0100 Received: from dyn-83-156-161-40.ppp.tiscali.fr (83.156.161.40) by mail.libertysurf.net (7.1.026) id 43DACD5D0012D1E6 for caml-list@yquem.inria.fr; Fri, 3 Feb 2006 19:35:20 +0100 From: Florent Monnier Organization: l'Association Linux-Nantes To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Caml with main in C + .cmxa Date: Fri, 3 Feb 2006 19:41:48 +0100 User-Agent: KMail/1.8.2 References: <200602031613.13954.fmonnier@linux-nantes.fr.eu.org> In-Reply-To: <200602031613.13954.fmonnier@linux-nantes.fr.eu.org> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200602031941.48639.fmonnier@linux-nantes.fr.eu.org> X-Face: "`cRNH1ww*pA7BMG\%C8RcGZR33F%q#d~:5U8b[K-NbYLSW_wpx@wk**lzqX3\F'a|gyP"K /emS.&rsSu'a7OiJH&d?,Z6OxW_L}I"z%\><#5LL%uQXl"QY@~9|XyM7{`tAq?Gp@ul&F'# Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43E3A268.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 cmxa:01 ocamlopt:01 cmxa:01 ocamlopt:01 -output-obj:01 cmx:01 gcc:01 usr:01 lib:01 ocaml':01 usr:01 lib:01 ocaml:01 -lunix:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 > > % ocamlopt -c -I +libMagick magick.cmxa app.ml > > % ocamlopt -output-obj -o mlobj.o unix.cmxa -I +libMagick magick.cmxa \ > > app.cmx > > (untill there, no error messages) > > > > % 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` > > > > and then with this last command, I get about 200 errors like this: > > [...] 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 ! --