Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ocamlopt, windows, and no console
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: Re: [Caml-list] ocamlopt, windows, and no console
> What Ocaml build are you using? If Mingw one then I am afraid it's not
> possible, but if it's MSVC-based I would try to play with
>
> -cclib /link -cclib /subsystem:windows
>
> options.

Indeed I was scanning the options, and found those. The problem is
that when you use that, you have to use WinMain instead...

C:\reflection>ocamlopt -cclib "/MD /link /SUBSYSTEM:WINDOWS" -o refl.exe -I +lab
lgl lablgl.cmxa lablglut.cmxa refl.ml
cl : Command line warning D4025 : overriding '/MT' with '/MD'
LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16
referenced in function _WinMainCRTStartup
refl.exe : fatal error LNK1120: 1 unresolved externals
Error during linking

I guess I'd have to provide a .c file which wraps ocaml's main
procedure then, which probably isn't too hard. Which then leads me to
requesting an option for the ocamlopt compiler for windows to have an
option to do this all automatically.

Jonathan