comp.lang.ada
 help / color / mirror / Atom feed
* Problems with the "mwindows" switch
@ 2015-05-22 18:35 NiGHTS
  2015-05-22 19:24 ` sbelmont700
  2015-05-23 20:23 ` gautier_niouzes
  0 siblings, 2 replies; 19+ messages in thread
From: NiGHTS @ 2015-05-22 18:35 UTC (permalink / raw)


I am trying to compile a GUI Windows application with Ada & Gtk in such a way as to only display the GUI window and not the console window. Early in my development I had success using the "mwindows" linker switch with my GTK window, but had to remove this switch at some point during development after I was no longer able to test run the program without it aborting immediately after startup. I suspect the problem is a conflict with something I've added to the GPR project file. 

In my program, the very first command it ever does is this:

Ada.Text_IO.Put_Line ("Hello World");

My expectation is that I would only see this "Hello World" message if I ran the executable from a console window but not when run directly from Windows Explorer.

Unfortunately when the "mwindows" flag is set not only does the GUI not appear as expected, but I don't get any feedback on the command console either. It makes me think that there is something fundamentally broken with the executable itself.

Here is a limited view of my GPR project file:


with "gtkada";
with "gnatcoll_sqlite";

project main is

    ...

    package Builder is
        for Default_Switches ("ada") use (
            "-g"         -- Compile with Symbols for Debugging
        );
    end Builder;

    package Compiler is
        for Default_Switches ("ada") use (
            "-g",        -- Compile with Symbols for Debugging
            "-gnat05",   -- Use Ada 2005
            "-gnata"     -- Compile all Assertions and enable all runtime checks
        );
    end Compiler;

    package Linker is
        for Default_Switches ("ada") use (
            "-g",            -- Compile with Symbols for Debugging
            "-pthread",      -- Link with pthread support
            "-lusb_driver",  -- Driver imported from C
            "-mwindows"      -- Launch Window, not console (* breaks program *)
        );
    end Linker;

    ...

end main;


Any hints on what could be wrong is be highly appreciated!

Thank you.

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

end of thread, other threads:[~2015-06-03  8:27 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-22 18:35 Problems with the "mwindows" switch NiGHTS
2015-05-22 19:24 ` sbelmont700
2015-05-22 19:51   ` NiGHTS
2015-05-23  5:33     ` Dmitry A. Kazakov
2015-05-23  7:20       ` NiGHTS
2015-05-23  8:06         ` Dmitry A. Kazakov
2015-05-28 22:19   ` Randy Brukardt
2015-05-28 23:49     ` sbelmont700
2015-05-29 21:24       ` Randy Brukardt
2015-05-29 21:36         ` Jeffrey R. Carter
2015-05-29 22:10           ` Simon Wright
2015-05-30  0:08           ` Dennis Lee Bieber
2015-06-01 21:24           ` Randy Brukardt
2015-06-01 23:12             ` sbelmont700
2015-05-29 11:00     ` Björn Lundin
2015-05-23 20:23 ` gautier_niouzes
2015-06-02 22:33   ` NiGHTS
2015-06-03  6:42     ` Simon Wright
2015-06-03  8:27       ` J-P. Rosen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox