Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Help using unix library?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Gerd Stolpmann <gerd@g...>
Subject: Re: [Caml-list] Help using unix library?
On Thu, 19 Apr 2001, Steve Stevenson wrote:
>Good afternoon:
>
>     I have references to the unix library using ocaml 3.01. The make
>file has
>
>     ebv0: $(BASICOBJECTS)
>	ocamlc -g -o ebv0 unix.cma $(BASICOBJECTS)
>	cp ebv0 Test/ebv0
>
>where BASICOBJECTS are all ocaml .cmo files. The complaint is
>
>Fatal error: this bytecode file cannot run on this bytecode interpreter
>Mismatch on primitive `unix_dup'
>
>Does this sound like an installation problem or a mistake in my
>coding? I'm not using dup.

Try

ocamlc -custom -g -o ebv0 unix.cma $(BASICOBJECTS)

This makes ebv0 a bit larger, but avoids that problem because ebv0 contains the
bytecode interpreter that is able to execute the code. By default (without
-custom), the generated executable uses the distributed ocamlrun interpreter.

Another solution is to create the right interpreter:

ocamlc -make-runtime -o myinterpreter unix.cma

(you must enumerate all libraries that refer to additional C libraries), then

ocamlc -use-runtime myintepreter -g -o ebv0 unix.cma $(BASICOBJECTS)

Gerd
-- 
----------------------------------------------------------------------------
Gerd Stolpmann      Telefon: +49 6151 997705 (privat)
Viktoriastr. 100             
64293 Darmstadt     EMail:   gerd@gerd-stolpmann.de
Germany                     
----------------------------------------------------------------------------
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr