问题描述
我已经安装了GNAT编程工作室(GPS)和GtkAda.它们似乎都可以正常工作,但是当我尝试从Template的New Project下构建Simple Window项目时,出现一堆错误,提示找不到文件gtk.ads".这似乎是目录/相关性的问题-GPS不知道在哪里寻找GtkAda.我正在运行Windows 7,并在C:\ GNAT \ 2011上安装了GPS,并在C:\ GtkAda上安装了GtkAda.我尝试将GtkAda添加到我的PATH中;目前,我的PATH用户变量包括C:\ GNAT \ 2011 \ bin,而我的路径系统变量包括C:\ GtkAda \ bin.对于解决此问题的任何建议,我们将不胜感激!
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!
推荐答案
这里有两件事.
首先,项目"是关键.每当您构建依赖于某些东西的东西时在像GtkAda这样的库上,如果(a)使用GNAT,则要容易得多专案来管理,以及(b)您使用图书馆提供的GPR-当然,总要假设是这样.
First, "project" is key. Whenever you're building something that dependson a library like GtkAda, it's much much easier if (a) you use GNATProject to manage it, and (b) you use the GPR(s) provided by the library- always assuming it does, of course.
就GtkAda而言,这意味着您的GPR需要与GtkAda一起使用;
In the case of GtkAda, that means that your GPR needs to "with" GtkAda;
with "gtkada";
project Tinkering is
...
第二个,gnatmake或gprbuild必须能够找到gtkada.gpr
.
Second, gnatmake or gprbuild needs to be able to find gtkada.gpr
.
最简单的方法是使用gtkada.gpr
的方式安装GtkAdagnatmake/gprbuild期望找到GPR文件的默认位置.这是$prefix/lib/gnat
. GtkAda遵守此约定,因此您可以安装GtkAda与编译器位于同一根目录下.我不知道为什么仍然不建议这样做.
The easiest way is to install GtkAda in such a way that gtkada.gpr
is inthe default place that gnatmake/gprbuild expect to find GPR files. Thisis $prefix/lib/gnat
. GtkAda obeys this convention, so you could installGtkAda under the same root as your compiler. I don't know why that's not recommended anyway.
如果您不想这样做,可以将正确的位置添加到环境变量ADA_PROJECT_PATH
,例如在您的情况下进行设置到C:\GtkAda\lib\gnat
.
If you don't want to do that, you can add the correct location to theenvironment variable ADA_PROJECT_PATH
, for example in your case set itto C:\GtkAda\lib\gnat
.
GtkAda自述文件中有很多好东西,位于 libre.adacore.com ,我看到的 GtkAda用户指南自述文件中的内容也包含在已安装的软件包(在您的情况下)为C:\GtkAda\doc\GtkAda\gtkada_ug
.
There is a lot of good stuff in the GtkAda README at libre.adacore.com, and inthe GtkAda User's Guide which I see from the README is also included with theinstalled package at (in your case) C:\GtkAda\doc\GtkAda\gtkada_ug
.
这篇关于Ada GPS IDE似乎找不到GtkAda的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!