'gnatmake'不被识别为内部或外部命令

时间:2019-05-29 15:50:16

标签: ada gnat

在Windows 10上使用GNAT时出现以下错误:

C:\Users\Admin>gnatmake - g helloworld.adb
'gnatmake' is not recognized as an internal or external command,
operable program or batch file.

驱动器E上文件的位置。

enter image description here

1 个答案:

答案 0 :(得分:3)

好的,正如Simon Wright在评论中已经指出的那样,请确保正确安装了GNAT。您可以下载社区版本here。然后,安装成功后:

  • 确保C:\GNAT\2018\bin在搜索路径中:
C:\> echo %PATH%
[...];C:\GNAT\2018\bin;[...]  
  • 确保gnatmake执行:
C:\> gnatmake --version
GNATMAKE Community 2018 (20180523-73)
Copyright (C) 1995-2018, Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • 切换到文件hello_world.adb所在的文件夹,并尝试使用以下命令编译文件:
E:\> gnatmake -g hello_world.adb
gcc -c -g hello_world.adb
gnatbind -x hello_world.ali
gnatlink hello_world.ali -g
相关问题