Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
-custom under win32
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-01-23 (21:59)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: -custom under win32
> Hi OCamler!
> I want to generate a "closed bytecode" executable under win32 (that
> contains the bytecode interpreter so that it can be used on a
> machine without OCaml installed). I'm just using the "standard"
> Ocaml run-time (I haven't written any C-code to incorporate in the
> run-time).
> 1. Do I understand well that I need the Microsoft Linker (cl.exe),
> but ONLY the linker, not the C compiler or assembler ?

You don't need the assembler, however you need the C libraries in
addition to the linker, so it looks like the full VC++ is needed to
get "ocamlc -custom" to work.

BUT: if there is no C code in your program, you can build a closed
bytecode executable just by concatenating the standard bytecode
interpreter with your bytecode executable:

copy /b \ocaml\bin\ocamlrun.exe+mybytecode.exe standalone.exe

or if you prefer the Unix-like way:

cat /ocaml/bin/ocamlrun.exe mybytecode.exe > standalone.exe

Easy, wasn't it.

> 2. If yes, does anybody know if this linker can be obtained/purchased/...
> without buying VC++ ?

No idea.

> 3. Can my problem be solved with Cygwin now, in a future version ?

The next release of OCaml will contain a Cygwin port, so you'll be
able to do "ocamlc -custom" without buying VC++.  I think you'll need
to distribute the Cygwin DLL along with the generated executable,

- Xavier Leroy