Ada GPS IDE can't seem to find GtkAda

血红的双手。 提交于 2019-12-22 11:29:57

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/7464251/ada-gps-ide-cant-seem-to-find-gtkada

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!