Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Steve Stevenson <steve@cs.clemson.edu>
To: caml-list@inria.fr
Subject: Missing something in getting C and Ocaml to Work Together
Date: Mon, 20 Nov 2000 16:05:20 -0500 (EST)	[thread overview]
Message-ID: <14873.37069.529974.959686@merlin.cs.clemson.edu> (raw)

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



             reply	other threads:[~2000-11-21  9:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-20 21:05 Steve Stevenson [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14873.37069.529974.959686@merlin.cs.clemson.edu \
    --to=steve@cs.clemson.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox