我正在尝试使用GPS IDE作为我在OS X El Capitan上的替代开发工具(远离OS X 10.5 Xcode 3.0)。但我偶然发现了一个奇怪的错误:
gnat bind myprog.bexch
gnatbind: Cannot find: myprog.bexch.ali
gprbuild: unable to bind myprog.adb [2016-01-20 18:49:07] process
exited with status 4, 100% (13/13), elapsed time: 04.77s
在我的目录中,我只能找到myprog.bexch。看起来像gnatbind不会产生myprog.bexch.ali
我的GPR看起来像这样:
project Amygdala_Cortex is
for Object_Dir use "Build/";
for Exec_Dir use "Build/Debug/";
for Library_Name use "";
for Library_Ali_Dir use "";
for Library_Kind use "static";
package Compiler is
for Default_Switches ("ada") use ("-g", "-O2", "-I/opt/local/include/aws", "-I/opt/local/include/aws/components");
end Compiler;
package Binder is
for Driver ("ada") use "/usr/local/gnat/bin/gnatbind";
end Binder;
package Linker is
for Linker_Options use ();
end Linker;
for Main use ("amygdala_cortex.adb");
end Amygdala_Cortex;
显然,我的目录中没有gprbind。
我在GPR中做错了什么或遗漏了什么?
我在El Capitan(10.11.2)上使用gnat-gpl-2015-x86_64-darwin(GNAT GPL 2015(20150428-49))。
感谢。
答案 0 :(得分:4)
我认为您应该尝试注释掉Binder'Driver
属性。让gprbuild根据需要自行查找并运行gnatbind。它将通过名为gprconfig
的工具在您的PATH上找到它,该工具生成配置文件(通常为auto.cgpr
)。
您正在使用AWS。不要将-I
开关用于编译器,而只需添加
with "aws";
项目中的,它将为编译器,链接器......添加相关的开关。
答案 1 :(得分:0)
感谢您的帮助。
这是我的新GPR,以防有人遇到类似的问题:
with "aws";
project myprog is
for Object_Dir use "Build/";
for Exec_Dir use "Build/Debug/";
for Library_Name use "";
for Library_Ali_Dir use "";
for Library_Kind use "static";
package Compiler is
for Default_Switches ("ada") use ("-g", "-O2");
end Compiler;
package Linker is
for Linker_Options use ();
end Linker;
for Main use ("myprog.adb");
end myprog;