caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "David Allsopp" <dra-news@metastack.com>
To: <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] ocamlopt, windows, and no console
Date: Tue, 11 Apr 2006 21:37:17 +0100	[thread overview]
Message-ID: <003701c65da7$b986ab10$867ba8c0@dra27a> (raw)

One other option is to change the startup mode of the executable after
compiling and linking it. I did this years ago with <cough> Visual Basic to
make true console applications (the reverse of your problem). I can't find
the code archive, but IIRC it involves changing a single byte in the PE
header that indicates the subsystem to use. The concept of main and winmain
come entirely from C - the actual entry point of your image is independent
of its subsystem so this gets around your linking problem.

I can't get at the machine with the archive of the tool I wrote for doing
this at the moment <sigh>. However, Microsoft have some utilities for doing
this although I don't know whether they will only work for programs
generated with their compiliers - google for Visual Basic's Link utility and
MSVC++'s editbin tool.

Hope this helps,


David

-----Original Message-----
From: caml-list-bounces@yquem.inria.fr
[mailto:caml-list-bounces@yquem.inria.fr] On Behalf Of Jonathan Roewen
Sent: 11 April 2006 04:08
To: Dmitry Bely
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ocamlopt, windows, and no console

> 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.

And back to the task at hand: how do I specify a .lib file on the
command line to get this all to link? I can't figure out the
cclib/ccopt options to pass to ocamlopt =/

Jonathan

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


             reply	other threads:[~2006-04-11 20:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-11 20:37 David Allsopp [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-04-10 15:19 Jonathan Roewen
2006-04-10 17:21 ` Dmitry Bely
2006-04-10 17:41   ` Igor Peshansky
2006-04-11  2:41   ` Jonathan Roewen
2006-04-11  3:07     ` Jonathan Roewen
2006-04-11 14:33       ` David Allsopp
2006-04-11 17:31     ` Harry Chomsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003701c65da7$b986ab10$867ba8c0@dra27a' \
    --to=dra-news@metastack.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).