English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Embedding OCaml - manual not up to date.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-02-16 (21:45)
From: Guillaume Yziquel <guillaume.yziquel@c...>
Subject: Embedding OCaml - manual not up to date.

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


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