在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
上文件的位置。
答案 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