[gtkada] Re: GtkAda Windows

Camek, Alexander Alexander.Camek at Elektrobit.com
Wed Apr 4 15:34:21 CEST 2007


Hi List,

After some try and error, i finally got a working result for my problem.
I want to post it here in order to help anybody who will read the posts and has got the same or a similar problem.

This solution was done with great help given by´Stefan Bellon.

First of all. Upon GtkAda 2.8.2 there is no gtkada.dll, so you have to build your own.
To do that you have to create your own gtkada.gpr file somewhere.
I have done that under Gtkada\lib\gnat. Then go to the source files and remove all pragmas for the Linker (Linker_Options) at the gtk.ads.

The gpr file looks like that:

project GtkAda is
for Languages    use ("Ada");
for Source_Dirs use ("../../include/gtkada");
for Source_List_File use "gtkada/gtkada.lgpr";
for Object_Dir   use "obj";
   
for Library_Dir use "lib";
for Library_Kind use "dynamic";
for Library_Name use "libgtkada";
      
package Compiler is
 for Default_Switches ("Ada") use ("-O2");
end Compiler;

package Linker is
for Default_Switches ("Ada") use 
("-LC:/Gtkada/bin")&
("-LC:/GtkAda/lib/gtkada/lib")&
("-llibgtkada")&
("-llibgtk-win32-2.0-0")&
("-llibgdk-win32-2.0-0")&
("-llibatk-1.0-0")&
("-llibgdk_pixbuf-2.0-0")&
("-llibpangowin32-1.0-0")&
("-llibpango-1.0-0")&
("-llibgobject-2.0-0")&
("-llibgmodule-2.0-0")&
("-llibglib-2.0-0");
end Linker; 

for Library_Options use
("-LC:/Gtkada/bin")&
("-LC:/GtkAda/include/gtkada")&
("-lgtkada")&
("-Wl,--export-dynamic")&
("-llibgtk-win32-2.0-0")&
("-llibgdk-win32-2.0-0")&
("-llibatk-1.0-0")&
("-llibgdk_pixbuf-2.0-0")&
("-llibpangowin32-1.0-0")&
("-llibpango-1.0-0")&
("-llibgobject-2.0-0")&
("-llibgmodule-2.0-0")&
("-llibglib-2.0-0");

end GtkAda;

The Library_Options are used to build the dll version of gtkada. You have to use the dlls in the GtkAda\bin directory to build it. For that you have to use the whole name given in the bin dir. 
With this project file you will get a working dll in the Library_Dir. You also have to put the gtkada.gpr path into your ADA_PROJECT_PATH

In order to use the dll or better to link against that you have to set following line in the specific project file:
for Library_Options use GtkAda.Linker'Default_Switches ("Ada");

After that you all is compiled well.

Thanks to all who helped me to get this thing to work.

Greetings Alexander


----------------------------------------------------------------
Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.



More information about the gtkada mailing list