使用项目依赖项“ gpr.gpr”与GNAT Studio编译Ada项目时,出现以下错误。
错误:错误
这是我的项目源代码:
with "gpr.gpr";
project Default is
for Soure_Dirs use ("src");
for Object_Dir use "obj";
for Main use ("main.adb")
end Default;
gpr.gpr中有一行引起错误:error-on-line
如果我要引用另一个依赖项,例如“ aws.gpr”,则一切正常。但是,“ gpr.gpr”和任何引用它的项目都不会编译。
输出到:gprbuild -vP2 -P default.gpr
Process tree, phase 1
Value_Of (library_type) is default "static"
Value_Of (xmlada_build) is default "static"
Value_Of (library_type) is default "static"
Value_Of (xmlada_build) is default "static"
Value_Of (library_type) is default "static"
Value_Of (xmlada_build) is default "static"
Value_Of (library_type) is default "static"
Value_Of (xmlada_build) is default "static"
Value_Of (library_type) is default "static"
Value_Of (xmlada_build) is default "static"
Value_Of (library_type) is default "static"
Value_Of (gpr_build) is "C:\GNAT\2020\bin"
ERROR: value %% is illegal for typed string %%
Done Process tree, phase 1, Success=FALSE
gpr.gpr:11:04: value "C:\GNAT\2020\bin" is illegal for typed string "build"
gprbuild: "default.gpr" processing failed
根据对原始问题的评论,似乎GPR_BUILD
设置了名为环境变量,而GPR_BUILD
项目使用了场景变量gpr.gpr
。在给定项目文件源的情况下,可以通过在Windows命令行上执行来重现该错误。
> set GPR_BUILD=C:\GNAT\2020\bin
接着
> gprbuild -P default.gpr
gpr.gpr:11:04: value "C:\GNAT\2020\bin" is illegal for typed string "build"
gprbuild: "default.gpr" processing failed
有关方案变量的更多信息,请参见GPRbuild用户指南,第2.4节。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句