Browse thread
Missing something in getting C and Ocaml to Work Together
-
Steve Stevenson
-
Xavier Leroy
- Sven LUTHER
- Wolfgang Lux
-
Xavier Leroy
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Sven LUTHER <luther@d...> |
| Subject: | Re: Missing something in getting C and Ocaml to Work Together |
On Wed, Nov 22, 2000 at 09:29:17PM +0100, Xavier Leroy wrote:
> > 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.
> > [...]
> > 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'
>
> Just run a.out directly, as in "./a.out". The -custom flag to ocamlc
> causes it to produce a "mixed" executable containing both OCaml
> bytecode and a specially tailored bytecode interpreter that includes
> your C code.
>
> Using the standard "ocamlrun" bytecode interpreter on such an
> executable fails, because ocamlrun doesn't contain the C functions that
> the bytecode part of the mixed executable calls ("cmainarg" here).
Any news on arch independent cutsom code you spoke about some time ago ?
Friendly,
Sven Luther