caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Windows (MSVC) applications without the console window...
@ 2004-05-14  9:39 Felix Winkelmann
  2004-05-14 14:28 ` Nicolas Cannasse
  0 siblings, 1 reply; 5+ messages in thread
From: Felix Winkelmann @ 2004-05-14  9:39 UTC (permalink / raw)
  To: caml-list

Hello!

(I'm new to this list, so if this has come up before,
my apologies)

I'm using OCaml 3.07 on Windows (MSVC build) and I wonder
whether it's possible to create standalone applications
that run without opening a console window. Some googling
directed me to mkwinapp (from the OCaml-Win32 distribution)
but apparently it doesn't work. I'm using Windows XP home.

Any ideas?


cheers,
felix

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Windows (MSVC) applications without the console window...
  2004-05-14  9:39 [Caml-list] Windows (MSVC) applications without the console window Felix Winkelmann
@ 2004-05-14 14:28 ` Nicolas Cannasse
  2004-05-14 16:58   ` Harry Chomsky
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Cannasse @ 2004-05-14 14:28 UTC (permalink / raw)
  To: Felix Winkelmann, caml-list

> Hello!
>
> (I'm new to this list, so if this has come up before,
> my apologies)
>
> I'm using OCaml 3.07 on Windows (MSVC build) and I wonder
> whether it's possible to create standalone applications
> that run without opening a console window. Some googling
> directed me to mkwinapp (from the OCaml-Win32 distribution)
> but apparently it doesn't work. I'm using Windows XP home.
>
> Any ideas?

You need to get OCaml Win32 API from here :
http://www.speakeasy.org/~hchomsky/ocaml-win32.html
And then a simple call to free_console() will remove the console.
One other way is to hack the exe in order to change its mode from "console
application" to "win32 application". Maybe an ocaml linker option would be
nice to do that.

Regards,
Nicolas Cannasse

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Windows (MSVC) applications without the console window...
  2004-05-14 14:28 ` Nicolas Cannasse
@ 2004-05-14 16:58   ` Harry Chomsky
  2004-05-17  8:18     ` Felix Winkelmann
  0 siblings, 1 reply; 5+ messages in thread
From: Harry Chomsky @ 2004-05-14 16:58 UTC (permalink / raw)
  To: Nicolas Cannasse, Felix Winkelmann, caml-list

> > I'm using OCaml 3.07 on Windows (MSVC build) and I wonder
> > whether it's possible to create standalone applications
> > that run without opening a console window. Some googling
> > directed me to mkwinapp (from the OCaml-Win32 distribution)
> > but apparently it doesn't work.

Can you be more specific about what doesn't work?  I haven't tried it with
the most recent versions of OCaml and Windows, so there may be bugs that I
don't know about.  Or you may be running into the limitations caused by
OCaml's use of a separate application for its runtime (ocamlrun.exe).  Make
sure you read and understand section 3 ("Subsystems") of the file build.txt
included with the OCaml-Win32 distribution.

> And then a simple call to free_console() will remove the console.

That might work, but I think it might look less clean than having a true
windows subsystem app.

> One other way is to hack the exe in order to change its mode from "console
> application" to "win32 application". Maybe an ocaml linker option would be
> nice to do that.

That's exactly what the "lkwinapp" and "mkwinapp" features of OCaml-Win32
do.  But again, if you read the "Subsystems" documentation mentioned above,
you will see why it might not work as well as you'd hope.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Windows (MSVC) applications without the console window...
  2004-05-14 16:58   ` Harry Chomsky
@ 2004-05-17  8:18     ` Felix Winkelmann
  2004-05-17  8:35       ` Xavier Leroy
  0 siblings, 1 reply; 5+ messages in thread
From: Felix Winkelmann @ 2004-05-17  8:18 UTC (permalink / raw)
  To: Harry Chomsky; +Cc: Nicolas Cannasse, caml-list

Harry Chomsky wrote:

>>>I'm using OCaml 3.07 on Windows (MSVC build) and I wonder
>>>whether it's possible to create standalone applications
>>>that run without opening a console window. Some googling
>>>directed me to mkwinapp (from the OCaml-Win32 distribution)
>>>but apparently it doesn't work.
> 
> 
> Can you be more specific about what doesn't work?  I haven't tried it with
> the most recent versions of OCaml and Windows, so there may be bugs that I
> don't know about.  Or you may be running into the limitations caused by
> OCaml's use of a separate application for its runtime (ocamlrun.exe).  Make
> sure you read and understand section 3 ("Subsystems") of the file build.txt
> included with the OCaml-Win32 distribution.

mkwinapp just appears to be ineffective on a bytecode-compiled
file. But (as I said in my followup), it works nicely with native
code compiled with ocamlopt. So it really seems to be related
to the invocation of ocamlrun (I guess),


cheers,
felix

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Windows (MSVC) applications without the console window...
  2004-05-17  8:18     ` Felix Winkelmann
@ 2004-05-17  8:35       ` Xavier Leroy
  0 siblings, 0 replies; 5+ messages in thread
From: Xavier Leroy @ 2004-05-17  8:35 UTC (permalink / raw)
  To: Felix Winkelmann; +Cc: Harry Chomsky, Nicolas Cannasse, caml-list

> mkwinapp just appears to be ineffective on a bytecode-compiled
> file. But (as I said in my followup), it works nicely with native
> code compiled with ocamlopt. So it really seems to be related
> to the invocation of ocamlrun (I guess),

For another example of how to build a non-console application in
bytecode, you could look at otherlibs/labltk/browser/Makefile.nt
in the OCaml source distribution.  Basically, the trick is to link as
follows:

ocamlc -custom ...  winmain.obj -cclib "/link /subsystem:windows"

when winmain.obj is obtained by compiling otherlibs/labltk/browser/winmain.c.

- Xavier Leroy

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-05-17  8:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-14  9:39 [Caml-list] Windows (MSVC) applications without the console window Felix Winkelmann
2004-05-14 14:28 ` Nicolas Cannasse
2004-05-14 16:58   ` Harry Chomsky
2004-05-17  8:18     ` Felix Winkelmann
2004-05-17  8:35       ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).