Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ada 使用“编译时出错”;探地雷达“;附属国_Ada_Gnat - Fatal编程技术网

Ada 使用“编译时出错”;探地雷达“;附属国

Ada 使用“编译时出错”;探地雷达“;附属国,ada,gnat,Ada,Gnat,在使用gnatstudio使用项目依赖项“gpr.gpr”编译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.gp

在使用gnatstudio使用项目依赖项“gpr.gpr”编译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中有一行导致错误:

如果我引用另一个依赖项,比如“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\u BUILD
的环境变量,而项目
GPR.GPR
使用了名为
GPR\u BUILD
的场景变量。给定项目文件源并在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用户指南。

您能否确认未设置名为
GPR\u BUILD
LIBRARY\u TYPE
的环境变量?在这种情况下,这样的环境变量可能会干扰您的构建。我确认没有使用这些名称设置任何环境变量。请从我的角度确认:当我尝试基于给定的项目源代码编译项目时,它在GNAT CE 2020上编译时不会出现问题(在Windows和Linux上)。您可能希望尝试使用
gprbuild-vP2-P default.gpr
从命令行编译以进一步隔离问题(查找包含
Value\u Of
C:\GNAT\2020\bin
)的行。感谢您的提示!我已将带有值的行放入问题中。请让我知道你是否想要剩余的输出或其他任何东西。