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 OAA04994 for caml-red; Mon, 12 Feb 2001 14:04:26 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA11977 for ; Mon, 12 Feb 2001 09:42:43 +0100 (MET) Received: from mailgw1.fhg.de (mailgw1.fhg.de [153.96.1.2]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f1C8ggX09371 for ; Mon, 12 Feb 2001 09:42:42 +0100 (MET) Received: from ilt.fhg.de (ilt.ilt.fhg.de [153.96.180.2]) by mailgw1.fhg.de (8.11.1/8.11.1) with ESMTP id f1C8gYE11713 for ; Mon, 12 Feb 2001 09:42:34 +0100 (MET) Received: from eent230 (eelta136.llt.RWTH-Aachen.DE [137.226.47.136]) by ilt.fhg.de (8.9.3/8.9.3) with SMTP id JAA23441 for ; Mon, 12 Feb 2001 09:42:33 +0100 (MET) Message-Id: <200102120842.JAA23441@ilt.fhg.de> From: wester@ilt.fhg.de To: caml-list@inria.fr Date: Mon, 12 Feb 2001 09:42:32 +0100 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: C-Interface problem Priority: normal X-mailer: Pegasus Mail for Win32 (v3.01d) Sender: weis@pauillac.inria.fr Hi, I want to write a small extension to OCaml (my first try). I have the following files: primitives.mli: external ilt_spawn : string -> string -> int = "ilt_spawn" primitives.ml: open Primitives let sp = ilt_spawn I type: ocamlc -c primitives.mli and get primitives.cmi. When I then try to compile primitives.ml with ocamlc -c primitives.ml I get the error message: The implementation primitives.ml does not match the interface primitives.cmi: The field 'ilt_spawn' is required but not provided. What did I do wrong? My primitives.c file reads: #include #include extern "C" { int ilt_spawn_(const char * cmd, const char * argument) { int ret = _spawnl(_P_NOWAIT, cmd, cmd, argument, NULL); return ret; } value ilt_spawn(value cmd, value argument) { int ret = ilt_spawn_((const char * ) String_val(cmd), (const char * )String_val(argument)); return Val_long(ret); } } I compile this file with VC++6.0. I would like to build a toplevel with: ocamlmktop -custom -o mytop primitives.obj primitives.cma Would this be correct? I would be very appreciative for help on this problem. With kind regards. Rolf Wester ------------------------------------- Rolf Wester wester@ilt.fhg.de