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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id AFFD2BC57 for ; Sun, 28 Mar 2010 22:05:27 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnIBAMJTr0tKfVK2mGdsb2JhbACREIoRCBUBAQEBAQgJDAcRIq0jgWmEPi6ITAEBAwWEfASDGQ X-IronPort-AV: E=Sophos;i="4.51,323,1267398000"; d="scan'208";a="47933822" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail2-smtp-roc.national.inria.fr with ESMTP; 28 Mar 2010 22:05:27 +0200 Received: by wyb33 with SMTP id 33so4575359wyb.27 for ; Sun, 28 Mar 2010 13:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type :content-transfer-encoding; bh=EpHlZlIybRR4OC9OvyAVegExstOvJaRQQn9axcl/Q2o=; b=lxseHhwb5DYSE+p/LTg8uVfdu74SIX68TFeeN7xR/H8aeKcRkHBWpS9g+HutnQR/2E DBZHhHJ/hnFd7rEFZvHbX8a/GAbtfFZZLeOGx+6pCK7jtZlb5er8ZomlRF0GNRGNRIP4 G57C4z+U0cpPYfWF/7ni7UUQKCDAnfvFdaRCM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=OrhVdeHOfA20Rg4XPzGfX8aABWHP9S5odOt52Qg/9BnhLxIJh+w30RXK6Vswfi8LJ4 QkvHVz8bn8piOkFu+j/bxQ7TnM0YVH7C5xjs7t2BzZLIOboBK7FI8w2YtZ4Vy1q0ZHbE uOM+zh2Y8f/pf9t0+8u7WAYhu6G8hhRo8eQnk= MIME-Version: 1.0 Received: by 10.216.89.147 with HTTP; Sun, 28 Mar 2010 13:05:26 -0700 (PDT) In-Reply-To: <1269771858.2863.10.camel@ratschan-laptop> References: <20100328100004.6833DBC57@yquem.inria.fr> <1269771858.2863.10.camel@ratschan-laptop> Date: Mon, 29 Mar 2010 00:05:26 +0400 Received: by 10.216.165.85 with SMTP id d63mr2425858wel.123.1269806726935; Sun, 28 Mar 2010 13:05:26 -0700 (PDT) Message-ID: <90823c941003281305n27ef6864w75f0ae10b510490e@mail.gmail.com> Subject: Re: [Caml-list] User-defined printers and external C code From: Dmitry Bely To: Caml List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; afaik:01 printf:01 ocamldebug:01 bytecode:01 ocaml:01 runtime:01 ocamlmklib:01 28,:98 wrote:01 abstract:01 dmitry:01 dmitry:01 caml-list:01 int:01 int:01 On Sun, Mar 28, 2010 at 2:24 PM, Stefan Ratschan wrote: >> The printing of Big_int is possible and AFAIK Big_int is an abstract >> data type. > >> let print_big_int (value_big_int:Big_int.big_int) =3D >> =A0 =A0Format.printf "%s" (Big_int.string_of_big_int value_big_int);; > > I see, thanks. If I interpret this correctly, then the same code is > loaded twice. Once in the program to be debugged, once for the printer. > > Now I have the following problem: The ADT I want to print uses an > external C library. Ocamldebug refuses to load it, saying: > (ocd) load_printer ../smath/libsmath.a > Error during code loading: ../smath/libsmath.a is not a bytecode object > file How is this C library linked into your Ocaml program? Probably the custom runtime? > Any ideas? Dynamic loading should help you (see ocamlmklib chapter in the manual). Then the C code will be placed into .so file and loaded automatically then needed. - Dmitry Bely