From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id EA6E4BB81 for ; Tue, 11 Apr 2006 19:31:27 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k3BHVRGZ012800 for ; Tue, 11 Apr 2006 19:31:27 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA31459 for ; Tue, 11 Apr 2006 19:31:26 +0200 (MET DST) Received: from mail1.sea5.speakeasy.net (mail1.sea5.speakeasy.net [69.17.117.3]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k3BHVOWf012789 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 11 Apr 2006 19:31:26 +0200 Received: (qmail 16009 invoked from network); 11 Apr 2006 17:31:23 -0000 Received: from dsl081-069-082.sfo1.dsl.speakeasy.net (HELO DBLSYG61) (hchomsky@[64.81.69.82]) (envelope-sender ) by mail1.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 11 Apr 2006 17:31:23 -0000 Message-ID: <0e6801c65d8d$be12c1b0$0300a8c0@DBLSYG61> From: "Harry Chomsky" To: "Jonathan Roewen" , "Dmitry Bely" Cc: References: <3bgljqhr.fsf@mail.ru> Subject: Re: [Caml-list] ocamlopt, windows, and no console Date: Tue, 11 Apr 2006 10:31:18 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Miltered: at nez-perce with ID 443BE7EF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 443BE7EC.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocamlopt:01 -cclib:01 -cclib:01 winmain:01 ocaml-win:01 lkwinapp:01 hchomsky:01 ocaml-win:01 wrote:01 caml-list:01 speakeasy:01 executable:03 cons:03 library:03 library:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 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