From: Dmitry Bely <dmitry.bely@gmail.com>
To: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] User-defined printers and external C code
Date: Mon, 29 Mar 2010 00:05:26 +0400 [thread overview]
Message-ID: <90823c941003281305n27ef6864w75f0ae10b510490e@mail.gmail.com> (raw)
In-Reply-To: <1269771858.2863.10.camel@ratschan-laptop>
On Sun, Mar 28, 2010 at 2:24 PM, Stefan Ratschan
<stefan.ratschan@cs.cas.cz> 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) =
>> Format.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
prev parent reply other threads:[~2010-03-28 20:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100328100004.6833DBC57@yquem.inria.fr>
2010-03-28 10:24 ` Stefan Ratschan
2010-03-28 20:05 ` Dmitry Bely [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=90823c941003281305n27ef6864w75f0ae10b510490e@mail.gmail.com \
--to=dmitry.bely@gmail.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).