From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id B4C15BBAF for ; Tue, 16 Feb 2010 22:45:19 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvACACOhektV2gB5ZGdsb2JhbACDBZgdGgsKBhQjrVuPZYEwglBbBIle X-IronPort-AV: E=Sophos;i="4.49,486,1262559600"; d="scan'208";a="57139370" Received: from emailfrontal2.citycable.ch ([85.218.0.121]) by mail4-smtp-sop.national.inria.fr with SMTP; 16 Feb 2010 22:45:19 +0100 Received: from [192.168.0.12] (unknown [85.218.92.99]) (Authenticated sender: guillaume.yziquel@citycable.ch) by emailfrontal2.citycable.ch (Postfix) with ESMTPA id 04E1FB10522; Tue, 16 Feb 2010 22:45:15 +0100 (CET) Message-ID: <4B7B120E.9010007@citycable.ch> Date: Tue, 16 Feb 2010 22:45:50 +0100 From: Guillaume Yziquel Reply-To: guillaume.yziquel@citycable.ch User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: OCaml List Subject: Embedding OCaml - manual not up to date. Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; guillaume:01 guillaume:01 ocaml:01 ocaml:01 compilation:01 ocamlopt:01 -output-obj:01 cmxa:01 cmx:01 cmxa:01 myprog:01 usr:01 lib:01 -lunix:01 pervasives:01 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/