From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 62F7EBB9A for ; Wed, 26 Oct 2005 00:25:57 +0200 (CEST) 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 j9PMPu2C027398 for ; Wed, 26 Oct 2005 00:25:57 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA02720 for ; Wed, 26 Oct 2005 00:25:56 +0200 (MET DST) Received: from anthony.ics.uci.edu (anthony.ics.uci.edu [128.200.39.241]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id j9PMPse4026365 for ; Wed, 26 Oct 2005 00:25:55 +0200 Received: (qmail 14727 invoked by uid 1000); 25 Oct 2005 22:26:12 -0000 Date: Tue, 25 Oct 2005 15:26:12 -0700 From: Christian Stork To: caml-list@inria.fr Subject: CamlIDL question Message-ID: <20051025222612.GA14471@anthony.ics.uci.edu> Mail-Followup-To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline X-Archive: encrypt User-Agent: Mutt/1.5.11 X-j-chkmail-Score: MSGID : 435EB0F4.000 on concorde : j-chkmail score : X : 0/20 1 X-j-chkmail-Score: MSGID : 435EB0F2.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 435EB0F4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 435EB0F2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; camlidl:01 camlidl:01 -header:01 idl:01 ocamlc:01 mli:01 ocamlc:01 gcc:01 gcc:01 stubs:01 -verbose:01 -custom:01 -cclib:01 stubs:01 cmo:01 X-Attachments: name="Makefile" name="ex.idl" type="text/x-csrc" name="ex.c" name="extest.ml" 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 --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I must be making a stupid mistake but I just don't see it. I put together a simple example that shows the problem. Even though the camlidl library is found its symbol "camlidl_free" is not. How can that be? Can anybody reproduce the problem or is this some hickup on my system? Here's what make produces (all files attached): make extest camlidl -header ex.idl ocamlc -c ex.mli ocamlc -c extest.ml gcc -c ex.c gcc -c ex_stubs.c ocamlc -c ex.ml ocamlc -verbose -custom -cclib -lcamlidl -o extest \ ex.o ex_stubs.o ex.cmo extest.cmo + gcc -Wl,-E -o 'extest' -I'/usr/lib/ocaml/3.08.3' /home/chs/tmp/camlprim262817.c '-L/usr/lib/ocaml/3.08.3' '-lcamlidl' 'ex.o' 'ex_stubs.o' -lcamlrun -lm -ldl -lcurses -lpthread ex_stubs.o: In function `camlidl_ex_g': ex_stubs.c:(.text+0x79): undefined reference to `camlidl_free' ex_stubs.o: In function `camlidl_ex_f': ex_stubs.c:(.text+0xd3): undefined reference to `camlidl_free' collect2: ld returned 1 exit status Error while building custom runtime system make: *** [extest] Error 2 -- Chris Stork <> Support eff.org! <> http://www.ics.uci.edu/~cstork/ OpenPGP fingerprint: B08B 602C C806 C492 D069 021E 41F3 8C8D 50F9 CA2F --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=Makefile OCAMLC := ocamlc all: extest ex.cmi: ex.mli $(OCAMLC) -c ex.mli ex.cmo: ex.cmi ex.ml $(OCAMLC) -c ex.ml ex.h ex.ml ex.mli ex_stubs.c: ex.idl camlidl -header ex.idl ex.o: ex.c ex.h gcc -c ex.c ex_stubs.o: ex_stubs.c ex.h gcc -c ex_stubs.c extest.cmo: ex.cmi extest.ml $(OCAMLC) -c extest.ml extest: extest.cmo ex.o ex_stubs.o ex.cmo $(OCAMLC) -verbose -custom -cclib -lcamlidl -o extest \ ex.o ex_stubs.o ex.cmo extest.cmo clean: rm -f *.cmo *.cmi *.o *~ rm -f ex_stubs.* ex.h ex.ml ex.mli extest --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ex.idl" typedef [abstract] struct foo_s * foo; foo g(); int f(foo e); --tThc/1wpZn/ma/RB Content-Type: text/x-csrc; charset=us-ascii Content-Disposition: attachment; filename="ex.c" #include "ex.h" struct foo_s {int i;}; foo g() { foo e = (foo) malloc (sizeof(struct foo_s)); e->i = 10; return e; } int f(foo e) { return e->i; } --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="extest.ml" open Ex ;; let e = g ();; print_int (f e);; print_string "\n";; --tThc/1wpZn/ma/RB--