Re: Gtk+ and Windows



inra tuxfamily org writes:
I'd like to know how to make a windows application so that console
DOS mode is avoided.

(A Windows console window has nothing to do with DOS.)

For the moment, it craches when linking.  It's may be due to the
fact that I don't provide any winMain function (the general way to
do windows apps), but this may not be the case.

Tell Visual C++ to build a GUI application, *do* provide a WinMain()
function, and in your WinMain(), do whatever you would have done in
the main() function. (Especially, for a GTK program, *don't* do any of
the generic Windows application stuff like creating windows or having
a Windows message loop. GTK handles all that.) If you need to access
the command line (argc and argv), include <stdlib.h> and use the
global variables __argc and __argv.

You probably should also tell Visual C++ to use the msvcrt runtime. I
think the IDEcalls it "multi-threaded dynamic C library" or something
like that. (Don't be afraid of the word "multi-threaded", this C
runtime is the preferred one to use also from single-threaded
programs.)

--tml





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]