[gtkada] Problem Linking a GtkAda Tutorial Program in a New Installation

Dmitry A. Kazakov mailbox at dmitry-kazakov.de
Thu Jun 4 21:36:13 CEST 2009


On Thu, 4 Jun 2009 14:22:06 -0400, you wrote:

> I am attending an Adacore training class on Ada Fundamentals this week,
> and am trying to get the GtkAda software package working as an extra
> exercise while the instructor is still available..

[...]

> Per the Gtkada User Guide, I am trying to compile one of the tutorial programs using the Windows command line as follows:
> 
> Gnatmake C:\GtkAda\share\examples\gtkada\tutorial\helloworld\hello.adb -IC:\Gtkada\include\gtkada
> 
> I get the following series of messages:
> 
>    gcc -c -IC:\Gtkada\include\gtkada hello.adb
>    gcc -c -IC:\Gtkada\include\gtkada hello_package.adb
>    gnatbind -IC:\Gtkada\include\gtkada -x hello.ali
>    gnatlink hello.ali
>    ...
>    ... numerous messages similar to the following
>    ...
>    b~hello.o:b~hello.adb:...: undefined reference to 'gdk__display_E'
>    b~hello.o:b~hello.adb:...: undefined reference to 'gdk__event_E'
>    b~hello.o:b~hello.adb:...: undefined reference to 'gdk__bitmap_E'
>    b~hello.o:b~hello.adb:...: undefined reference to 'gdk__pixmap_E'
>    ...
>    ... numerous messages similar to the above
>    ...
>    collect2: ld returned 1 exit status
>    gnatlink: error when calling C:\GNAT\2008\bin/gcc.exe
>    gnatmake: *** link failed.
> 
> It appears I am missing a link library reference, but I do not know how to
> specify it and which of the many GtkAda folders to point to.  In the
> windows environment PATH are the two folders:  C:\GNAT\2008\bin and
> C:\GtkAda\bin.  The course instructor suggested I write this Email for
> assistance.

Hmm, he should have better advised you to use the GPS and the gpr project
files distributed with GtkAda.

Anyways, if you for some reason want to use bare gnatmake then under
Windows you indeed have to specify all libraries you need. There are a few
of them, the exact list is in the gtkada.gpr file.

The command might look like:

gnatmake -static -IC:/GtkAda/include/gtkada hello.adb -largs
-LC:/GtkAda/lib/gtkada -lgtkada -LC:/GtkAda/lib -lgtk-win32-2.0
-lgdk-win32-2.0 -lglib-2.0 -lgobject-2.0 -lgdk_pixbuf-2.0 -lpango-1.0
-mwindows

(I assumed static linking. Under Linux there is a script you can add to the
command line in order get all libraries: `gtkada-config --static`)

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



More information about the gtkada mailing list