From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA22285 for caml-red; Thu, 23 Nov 2000 13:22:38 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA27775 for ; Wed, 22 Nov 2000 11:06:53 +0100 (MET) Received: from wildcat.uni-muenster.de (WI.UNI-MUENSTER.DE [128.176.159.139]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eAMA6nP04060 for ; Wed, 22 Nov 2000 11:06:53 +0100 (MET) Message-Id: <200011221006.eAMA6nP04060@concorde.inria.fr> Received: from POSEIDON.UNI-MUENSTER.DE ([128.176.158.97]) by wildcat.uni-muenster.de with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id WRS6MHWC; Wed, 22 Nov 2000 11:06:48 +0100 X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0 To: Steve Stevenson cc: caml-list@inria.fr Subject: Re: Missing something in getting C and Ocaml to Work Together In-Reply-To: Message from Steve Stevenson of "Mon, 20 Nov 2000 16:05:20 EST." <14873.37069.529974.959686@merlin.cs.clemson.edu> References: <14873.37069.529974.959686@merlin.cs.clemson.edu> Reply-to: wlux@uni-muenster.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 22 Nov 2000 11:06:47 +0100 From: Wolfgang Lux Sender: weis@pauillac.inria.fr Steve Stevenson wrote > And I use this to compile > > ocamlc main.cmo -custom -cclib csrc/libmainc.a > > When I do, I get no errors but > > ocamlrun a.out > > produces > > Fatal error: this bytecode file cannot run on this bytecode interpreter > Mismatch on primitive `cmainarg' > > What am I doing wrong? You use the standard bytecode interpreter, which does not know anything about your C function, to start your custom executable. Just use ./a.out to start the program. Actually, you (nearly) never have to call ocamlrun yourself, the bytecode program contains some nice magic to start up the right bytecode interpreter for you. Regards Wolfgang -- Wolfgang Lux Phone: +49-251-83-38263 Institut fuer Wirtschaftinformatik FAX: +49-251-83-38259 Universitaet Muenster Email: wlux@uni-muenster.de