I'm having troubles distributing a GtkAda application on Windows. I made an executable (with Windows native compiler) and tried using it on another Windows computer. However, I get errors about dlls missing.
I tried distributing with my .exe three folders.
bin
including the dlls installed by GtkAda,etc
includingfonts
,gtk-3.0
andpango
,lib
includinggtk-3.0
with dlls too.
This is what I read from the GtkAda documentation
I think I maybe forgot to specify something in the project file
Here my GPS project file
with "C:\GNAT\GTK\lib\gnat\gtkada";
project Logfilter is
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Exec_Dir use "exec";
for Main use ("log_filter_main.adb");
package Builder is
for Executable ("main.adb") use "Logs_Filter";
end Builder;
package Compiler is
for Switches ("ada") use ("-Wl,--subsystem,windows");
end Compiler;
end Logfilter;
I'm using a glade (gtk 3.14) file and GtkAda 2019.
Thank you.
Where did you put the main executable (
log_filter_main.exe
)? What libraries are missing?When I create a directory structure using the batch program below (change the variables
GTKADA_INSTALL_DIR
andTARGET_DIR
to match your situation), and then copy my executable (a simple GtkAda program) into%TARGET_DIR%\bin
, then this executable runs just fine. It's important that the application resides in thebin
folder such that the correct GTK runtime libraries will be found during startup.create_standalone.bat
Regarding the project file: first, it's not completely clear why the
Builder
package is needed, but I might lack some project specific knowledge/requirements here. Second, if you want to get rid of the console window popping up when starting the GUI application, then you might want to useinstead of
Note:
Small additional note beyond the scope of the question (you may already have thought of it): please do not forget to quit the GTK main application when you close the main window. Define (for example):
and then register it as a callback when the main window is initialized:
If the
Gtk.Main.Main_Quit
call is omitted, then the program (process) will keep running after you close the main window (at least when you use the-mwindows
linker option).