Building Gtkada on Windows 11 gives errors/warnings on misc.c

Rebooted Windows. Deleted source directory and created it again. Same errors.
Again deleted the and created it. Turned off real tine virus scanner (F-Secure). Ran ./configure. The error of file removal is now gone. The mismatch of the GTK+ versions is still there: installed version is mingw-w64-x86_64-gtk3 3.24.49-1, ./configure wants it >= 3.24.24 but decides that installed version is not OK.
Looking in the config.log it seams that ld cannot find the libraries. However, they are available in /mingw64/bin.
Then I remembered something I did on Ubuntu, somewhere back in 2014. In order to get things compiling I needed to set envvar LIBRARY_PATH, so now:
$ export LIBRARY_PATH=/mingw64/bin
ran ./configure again. It now finishes without errors. So time for make. Make still fails on misc.c (misc_generated.c compiled with no error):

   [C]            misc_generated.c
   [C]            misc.c
D:\ada\gtkada-25.0.0\src\misc.c: In function 'ada_g_filename_from_uri':
D:\ada\gtkada-25.0.0\src\misc.c:89:10: error: implicit declaration of function 'g_filename_from_uri_
utf8'; did you mean 'g_filename_from_utf8'? [-Wimplicit-function-declaration]
   89 |   return g_filename_from_uri_utf8 (uri, hostname, error);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
      |          g_filename_from_utf8
D:\ada\gtkada-25.0.0\src\misc.c:89:10: error: returning 'int' from a function with return type 'gcha
r *' {aka 'char *'} makes pointer from integer without a cast [-Wint-conversion]
   89 |   return g_filename_from_uri_utf8 (uri, hostname, error);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\ada\gtkada-25.0.0\src\misc.c: In function 'ada_g_filename_from_utf8':
D:\ada\gtkada-25.0.0\src\misc.c:103:10: error: implicit declaration of function 'g_filename_from_utf
8_utf8'; did you mean 'g_filename_from_utf8'? [-Wimplicit-function-declaration]
  103 |   return g_filename_from_utf8_utf8
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
      |          g_filename_from_utf8
D:\ada\gtkada-25.0.0\src\misc.c:103:10: error: returning 'int' from a function with return type 'gch
ar *' {aka 'char *'} makes pointer from integer without a cast [-Wint-conversion]
  103 |   return g_filename_from_utf8_utf8
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
  104 |     (utf8string, len, bytes_read, bytes_written, error);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\ada\gtkada-25.0.0\src\misc.c: In function 'ada_g_filename_to_uri':
D:\ada\gtkada-25.0.0\src\misc.c:117:10: error: implicit declaration of function 'g_filename_to_uri_u
tf8'; did you mean 'g_filename_to_utf8'? [-Wimplicit-function-declaration]
  117 |   return g_filename_to_uri_utf8 (filename, hostname, error);
      |          ^~~~~~~~~~~~~~~~~~~~~~
      |          g_filename_to_utf8
D:\ada\gtkada-25.0.0\src\misc.c:117:10: error: returning 'int' from a function with return type 'gch
ar *' {aka 'char *'} makes pointer from integer without a cast [-Wint-conversion]
  117 |   return g_filename_to_uri_utf8 (filename, hostname, error);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\ada\gtkada-25.0.0\src\misc.c: In function 'ada_g_filename_to_utf8':
D:\ada\gtkada-25.0.0\src\misc.c:131:10: error: implicit declaration of function 'g_filename_to_utf8_
utf8'; did you mean 'g_filename_to_utf8'? [-Wimplicit-function-declaration]
  131 |   return g_filename_to_utf8_utf8
      |          ^~~~~~~~~~~~~~~~~~~~~~~
      |          g_filename_to_utf8
D:\ada\gtkada-25.0.0\src\misc.c:131:10: error: returning 'int' from a function with return type 'gch
ar *' {aka 'char *'} makes pointer from integer without a cast [-Wint-conversion]
  131 |   return g_filename_to_utf8_utf8
      |          ^~~~~~~~~~~~~~~~~~~~~~~
  132 |     (opsysstring, len, bytes_read, bytes_written, error);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\ada\gtkada-25.0.0\src\misc.c: In function 'ada_gdk_event_get_keyval':
D:\ada\gtkada-25.0.0\src\misc.c:820:39: warning: result of '2 << 31' requires 34 bits to represent,
but 'int' only has 32 bits [-Wshift-overflow=]
  820 | #define ada_gdk_invalid_gint_value ((2<<31) - 1)
      |                                       ^~
D:\ada\gtkada-25.0.0\src\misc.c:869:12: note: in expansion of macro 'ada_gdk_invalid_gint_value'
  869 |     return ada_gdk_invalid_gint_value;
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
D:\ada\gtkada-25.0.0\src\misc.c: In function 'ada_gtk_application_startup':
D:\ada\gtkada-25.0.0\src\misc.c:2056:5: warning: initialization discards 'const' qualifier from poin
ter target type [-Wdiscarded-qualifiers]
 2056 |     g_application_get_application_id (G_APPLICATION (application));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   compilation of misc.c failed

gprbuild: *** compilation phase failed
make: *** [Makefile:84: build_library_type/static] Error 4

Do this before calling make:

export CFLAGS=-'Wno-error=implicit-function-declaration -Wno-error=int-conversion'

Wow! That does the trick. Now all the other tastes (static-pic, relocatoble, testgtk, etc) are build and “make install” indeed installs libgtkada.a adn libgtlkada.dll

For sure, without your help I would never ever have figured that out, not in a million years
Thanks, Dmitry!!
Now lets create a test application …

Yes! succeeded in creating a simple Hello_Wprld app, Turns out that the LIBRARY_PATH envvar is needed for linking in a Windows environment, as well as an augmented Windows PATH so that the library .DLL’s can be found at run time (in /mingw64/bin) . No surprises there.

Again, thanks a lot !

This is hello world in GtkAda.

with "gtkada.gpr";
project Hello is
   for Main use ("hello.adb");
   package Linker is
      for Default_Switches ("Ada") use ("-mwindows");
   end Linker;
end Hello;

and

with Gtk.Label;    use Gtk.Label;
with Gtk.Window;   use Gtk.Window;
with Gtk.Widget;   use Gtk.Widget;
with Gtk.Table;    use Gtk.Table;

with Ada.Unchecked_Conversion;
with Gdk.Event;
with Gtk.Main;

procedure Hello is
   Window : Gtk_Window;
   Grid   : Gtk_Table;
   Label  : Gtk_Label;

   type Event_Callback is not null access function
        (  Self  : access Gtk_Widget_Record'Class;
           Event : Gdk.Event.Gdk_Event
        )  return Boolean;
   function "+" is
      new Ada.Unchecked_Conversion
          (  Event_Callback,
             Cb_Gtk_Widget_Gdk_Event_Boolean
          );
   type Destroy_Callback is access procedure
        (  Widget : access Gtk_Widget_Record'Class
        );
   function "+" is
      new Ada.Unchecked_Conversion
          (  Destroy_Callback,
             Cb_Gtk_Widget_Void
          );

   function Delete_Event_Handler
            (  Widget : access Gtk_Widget_Record'Class;
               Event  : Gdk.Event.Gdk_Event
            )  return Boolean is
   begin
      return False;
   end Delete_Event_Handler;

   procedure Destroy_Handler
             (  Widget : access Gtk_Widget_Record'Class
             )  is
   begin
      Gtk.Main.Main_Quit;
   end Destroy_Handler;
begin
   Gtk.Main.Init;
   Gtk.Window.Gtk_New (Window);
   Window.Set_Title ("Hello World");
   Window.On_Delete_Event (+Delete_Event_Handler'Access);
   Window.On_Destroy (+Destroy_Handler'Access);

   Gtk_New (Grid, 1, 1, False);
   Window.Add (Grid);
   Gtk_New (Label);
   Label.Set_Text ("Hello World!");
   Grid.Attach (Label, 0, 1, 0, 1);
   Label.Show;

   Grid.Show;
   Window.Show;

   Gtk.Main.Main;
end Hello;

There is some local to global access type unchecked conversions because I want it be a single file. Normally you move handlers into packages and no conversion would be necessary.

Thanks for the example. Without being pedantic, I am using Ada and Gtkada (and Glade) for over 10 years. So mine Hello_World was almost the same. And yes, of course widget handlers should be in separate packages.
What’s more, I am an happy user of your Gtk.Main.Router package.
But this GtkAda installation problem is way above my knowledge. And to be honest, I have no idea what the CFLAGS do, besides being input for gcc. Nor what misc.c and misc_generated.c do. Going to look into that tomorrow

Wno-error=implicit-function-declaration -Wno-error=int-conversion forbid treating certain warnings (implicit function declaration and int conversion) as errors. At some point gcc default behaviour was changed. This is the reason why legal C code does not compile anymore. gcc from my trusty GNAT 2010 compiles it and your newer compiler does not.