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 B3B1BBBC4 for ; Fri, 3 Feb 2006 16:04:52 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k13F4qR3032765 for ; Fri, 3 Feb 2006 16:04:52 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA15708 for ; Fri, 3 Feb 2006 16:04:51 +0100 (MET) 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 k13F4pAl032762 for ; Fri, 3 Feb 2006 16:04:51 +0100 Received: from dyn-83-156-161-40.ppp.tiscali.fr (83.156.161.40) by mail.libertysurf.net (7.1.026) id 439E8311008C722D for caml-list@inria.fr; Fri, 3 Feb 2006 16:04:51 +0100 From: Florent Monnier Organization: l'Association Linux-Nantes To: caml-list@inria.fr Subject: Caml with main in C + .cmxa Date: Fri, 3 Feb 2006 16:13:13 +0100 User-Agent: KMail/1.8.2 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200602031613.13954.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="us-ascii" Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43E37114.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43E37113.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; cmxa:01 ocaml:01 ocaml:01 cmxa:01 lib:01 ocamlopt:01 ocamlopt:01 -output-obj:01 cmx:01 gcc:01 usr:01 lib:01 ocaml':01 usr: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 Hi, I'm compiling the beginning of a small app written in OCaml but with the main which boot the app in C. The OCaml app should also use a .cmxa lib, which is a binding to a C lib. Without the .cmxa binding, compiling works good with this: % ocamlopt -c app.ml % ocamlopt -output-obj -o mlobj.o unix.cmxa app.cmx % gcc main.c -o myapp.opt mlobj.o \ -I'/usr/local/lib/ocaml' \ -L/usr/local/lib/ocaml \ -lunix -lasmrun -lm -ldl But now I'm trying to figure out how to compile with the .cmxa which is the binding to ImageMagick (hump ~contrib:487) To compile C code without caml pieces with the libMagick is done this way: gcc `Magick-config --cflags --cppflags` app.c `Magick-config --ldflags --libs` So here is my attempt to mix all together: % 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: -------------------- mlobj.o: In function `camlMagick__scale_1177': : undefined reference to `fun_scaleimage' mlobj.o: In function `camlMagick__sharpen_1136': : undefined reference to `fun_sharpenimage' mlobj.o: In function `camlMagick__blur_channel_1193': : undefined reference to `fun_blurimagechannel' -------------------- 'fun_scaleimage' and the others are the names of the functions in the C file of the OCaml-libMagick binding. So what is the error I have done? What should I correct to get the app compliled? -- Thanks in advance Florent Monnier