4

I have installed both the GNAT Programming Studio (GPS) and GtkAda. They both seem to work fine, but when I try to build the Simple Window project under New Project from Template, I get a bunch of errors saying "file gtk.ads not found." This seems to be a directory/dependency sort of problem - GPS doesn't know where to look for GtkAda. I'm running Windows 7, and have GPS installed at C:\GNAT\2011, and GtkAda installed at C:\GtkAda. I tried adding GtkAda to my PATH; at the moment my PATH user variable includes C:\GNAT\2011\bin, and my Path System variable includes C:\GtkAda\bin. Any advice on resolving this problem is greatly appreciated!

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
Gautam
  • 1,732
  • 4
  • 18
  • 26
  • Cross posted to [comp.lang.ada:GPS and GTK Options](http://groups.google.com/group/comp.lang.ada/browse_thread/thread/425d51d43921b223). – trashgod Sep 19 '11 at 12:35

1 Answers1

8

There are two things here.

First, "project" is key. Whenever you're building something that depends on a library like GtkAda, it's much much easier if (a) you use GNAT Project to manage it, and (b) you use the GPR(s) provided by the library - always assuming it does, of course.

In the case of GtkAda, that means that your GPR needs to "with" GtkAda;

with "gtkada";
project Tinkering is
   ...

Second, gnatmake or gprbuild needs to be able to find gtkada.gpr.

The easiest way is to install GtkAda in such a way that gtkada.gpr is in the default place that gnatmake/gprbuild expect to find GPR files. This is $prefix/lib/gnat. GtkAda obeys this convention, so you could install GtkAda under the same root as your compiler. I don't know why that's not recommended anyway.

If you don't want to do that, you can add the correct location to the environment variable ADA_PROJECT_PATH, for example in your case set it to C:\GtkAda\lib\gnat.

There is a lot of good stuff in the GtkAda README at libre.adacore.com, and in the GtkAda User's Guide which I see from the README is also included with the installed package at (in your case) C:\GtkAda\doc\GtkAda\gtkada_ug.

Simon Wright
  • 25,108
  • 2
  • 35
  • 62