caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Ben Jakb" <ben.jakb@gmail.com>
To: matthieu.dubuget@gmail.com, caml-list@inria.fr
Subject: Re: [Caml-list] Shared libraries with ocamlopt callable from C (without main())?
Date: Sat, 10 Jan 2009 19:08:39 +0100	[thread overview]
Message-ID: <fa75c1020901101008g7fb248f6h36f8cd1fe5910515@mail.gmail.com> (raw)
In-Reply-To: <4968C07F.1020207@gmail.com>

> I introduced a bug: the string in the C file is "add_five", while the
> registered one in the ml file is "add five".

Touché. I suppose I looked to long to this code
And yes it works now, thanks ...

2009/1/10 Matthieu Dubuget <matthieu.dubuget@gmail.com>:
> Ben Jakb a écrit :
>> matthieu,
>> thanks for the interesting answer.
>> Unfortunately I can't build 'mycamlbuild.ml', and it is a bit too
>> advanced for me to understand.
>
> If you have a > 3.10 version of ocaml, you don't need to compile
> yourself myocamlbuild.ml.
>
> This is done automatically by ocamlbuild.
>
>>
>> Therefore I'll first go with your standard build commands. So - after
>> modifing the sources according to your suggestions I run:
>>
>> BUILD
>>     ocamlopt -c add5.ml
>>     ocamlopt -c add5wrapperlib.c
>>     ocamlopt -o add5lib.native.so -ccopt -shared add5.cmx add5wrapperlib.o
>>     ocamlc.opt -ccopt -Iinclude -c main.c
>>     gcc -o maintest.native main.o -l:add5lib.native.so -L. -Wl,-rpath=.
>>
>> EXECUTION
>>     cp add5lib.native.so  lib/
>>     ./maintest.native
>>
>> ERROR
>> "maintest.native: add5wrapperlib.c:24: add5wrapper: Assertion `cbk' failed.
>> Aborted"
>>
>> This is the referenced line:
>>
>>     $ sed -n 24p add5wrapperlib.c
>> CAMLCBK_INIT(cbk, "add_five");
>>
>>
>> Any ideas what' wrong here?
>
> Yes ;-)
>
> This is exactly why i use assert there.
>
> I introduced a bug: the string in the C file is "add_five", while the
> registered one in the ml file is "add five".
>
>
> Hope this helps
>


  reply	other threads:[~2009-01-10 18:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08 22:45 Ben Aurel
2009-01-09  8:21 ` [Caml-list] " Matthieu Dubuget
2009-01-09  8:44   ` [Caml-list] Shared libraries with ocamlopt callable from C(without main())? RABIH.ELCHAAR
2009-01-10  1:22   ` [Caml-list] Shared libraries with ocamlopt callable from C (without main())? Ben Jakb
2009-01-10 11:50     ` Matthieu Dubuget
2009-01-10 15:28       ` Ben Jakb
2009-01-10 15:36         ` Matthieu Dubuget
2009-01-10 18:08           ` Ben Jakb [this message]
     [not found]       ` <200901101911.41594.monnier.florent@gmail.com>
2009-01-10 18:18         ` Ben Jakb
2009-01-11 16:27     ` [Caml-list] " Xavier Leroy

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=fa75c1020901101008g7fb248f6h36f8cd1fe5910515@mail.gmail.com \
    --to=ben.jakb@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=matthieu.dubuget@gmail.com \
    /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).