caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Missing something in getting C and Ocaml to Work Together
@ 2000-11-20 21:05 Steve Stevenson
  2000-11-22 10:06 ` Wolfgang Lux
  2000-11-22 20:29 ` Xavier Leroy
  0 siblings, 2 replies; 6+ messages in thread
From: Steve Stevenson @ 2000-11-20 21:05 UTC (permalink / raw)
  To: caml-list

Good Afternoon,

	I have a very simple application. I have the main in ocaml and 
the rest of the system in C. I'm just trying something very straight
forward.


external cmainarg : int -> string array -> unit = "cmainarg"
external io_infile_stdin : unit -> unit = "io_infile_stdin"
external cmaininit : unit -> unit = "cmaininit"


let main() =
  cmainarg  (Array.length Sys.argv)  Sys.argv;
  io_infile_stdin ();
  cmaininit();
  0
(*end*)

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?

Thanks. (NO, I don't know who will be president yet. :-)

steve



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-11-25 16:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-20 21:05 Missing something in getting C and Ocaml to Work Together Steve Stevenson
2000-11-22 10:06 ` Wolfgang Lux
2000-11-22 20:29 ` Xavier Leroy
2000-11-23 12:56   ` Sven LUTHER
2000-11-23 22:25     ` Typing the result of a function Mattias Waldau
2000-11-25 15:54       ` Pierre Weis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).