caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Guillaume Yziquel <guillaume.yziquel@citycable.ch>
To: OCaml List <caml-list@inria.fr>
Subject: Embedding OCaml - manual not up to date.
Date: Tue, 16 Feb 2010 22:45:50 +0100	[thread overview]
Message-ID: <4B7B120E.9010007@citycable.ch> (raw)

Hi.

The manual is not up to date when it comes to embedding OCaml code into 
C code.

http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#toc134

Specifically the section

	18.7.5  Embedding the Caml code in the C code

and the piece of compilation code I'm having trouble with is the following:

>         ocamlopt -output-obj -o camlcode.o unix.cmxa other .cmx and .cmxa files
>         cc -o myprog C objects and libraries \
>            camlcode.o -L/usr/local/lib/ocaml -lunix -lasmrun

This code complains about missing symbols from pervasives.

So I adapt it by compiling with pervasives.cmx, and I get

> ocamlopt -output-obj -o camlcode.o pervasives.cmx
> ld: /usr/lib/ocaml/pervasives.o: No such file: No such file or directory
> File "caml_startup", line 1, characters 0-1:
> Error: Error during linking
> make: *** [camlcode.o] Erreur 

But I cannot find pervasives.o anywhere.

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/


             reply	other threads:[~2010-02-16 21:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16 21:45 Guillaume Yziquel [this message]
2010-02-16 22:35 ` Guillaume Yziquel

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=4B7B120E.9010007@citycable.ch \
    --to=guillaume.yziquel@citycable.ch \
    --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).