From: David LONY <david.lony@pragmadev.com>
To: Alain Frisch <alain@frisch.fr>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Interface C and Caml
Date: Fri, 04 Jan 2008 10:24:31 +0100 [thread overview]
Message-ID: <477DFB4F.4000105@pragmadev.com> (raw)
In-Reply-To: <477D3F76.6040401@frisch.fr>
It work well!!
Thanks a lot Alain
David
Alain Frisch a écrit :
> David LONY wrote:
>> ocamlopt -output-obj truc.ml -o truc.o
>> gcc -c test.c
>> gcc -o test test.o truc.o -L/usr/lib/ocaml/3.09.2 -lasmrun
>
> Two problems here:
>
> 1. the first line first compiles truc.ml into truc.cmx/truc.o as
> usual, and then combine truc.o with stdlib.a and a temporary startup
> object into truc.o. It seems that the linker first creates a fresh
> truc.o file before reading the existing truc.o, so the native code
> produced by the compiler is actually lost. You should use a different
> file name:
>
> ocamlopt -output-obj truc.ml -o truc_main.o
>
>
> 2. the last line should mention the -lm and -ldl libraries, as can be
> found by:
>
> grep NATIVECCLIBS `ocamlc -where`/Makefile.config
>
> So:
>
> gcc -o test test.o truc_main.o -L/usr/lib/ocaml/3.09.2 -lasmrun -lm -ldl
>
> -- Alain
>
>
prev parent reply other threads:[~2008-01-04 9:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-03 14:54 David LONY
2008-01-03 20:03 ` [Caml-list] " Alain Frisch
2008-01-04 9:24 ` David LONY [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=477DFB4F.4000105@pragmadev.com \
--to=david.lony@pragmadev.com \
--cc=alain@frisch.fr \
--cc=caml-list@yquem.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