Skip to content

WinMain is never called #2

Description

@Lucretia

You should create the solution with the -n passed to the binder and the following source.

--------------------------------------------------------------------------------
with WindowsApp1;

package body WinMainStartup is

    ----------------------------------------------------------------------------
    function  WinMain (hInstance : System.Address; hPrevInstance : System.Address; lpCmdLine : System.Address; nCmdShow : Integer ) return Integer is
        procedure adainit;
        pragma Import (C, adainit, "adainit");

        procedure adafinal;
        pragma Import (C, adafinal, "adafinal");

        -- procedure main;
        -- pragma Import(Ada, main, "WindowsApp1");
    begin
        adainit;
        -- main;
        WindowsApp1;
        adafinal;
        return 0;
    end;

end;

Ideally gnat should generate a [w]WinMain on windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions