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: Harry Chomsky <harry@c...>
Subject: Re: [Caml-list] ocamlopt, windows, and no console
Jonathan Roewen wrote:
>> -cclib /link -cclib /subsystem:windows
>
> Indeed I was scanning the options, and found those. The problem is
> that when you use that, you have to use WinMain instead...

You can use the linker flag "/entry:mainCRTStartup" alongside the 
"/subsystem:windows" flag to achieve what you want: an executable with no 
console but using main() as the starting point.  That's what my OCaml-Win32 
library does when you link the tiny file lkwinapp.obj into your application. 
There's some discussion of the pros and cons of this approach in the 
build.txt file.  If you're curious, the library is available at:

http://www.speakeasy.org/~hchomsky/ocaml-win32.html