我使用Linux Mint操作系统。为了编写Ada程序,我使用命令“sudo apt-get install gnat”来安装gnat。然后创建了一个简单的“hello world”程序。
with Ada.Text_IO;
procedure Hello is
begin
Ada.Text_IO.Put_Line("Hello, world!");
end Hello;
将其另存为“hello.adb”
尝试从保存位置运行它,打开终端并键入,得到以下结果:
$ cd /media/disk1/ada\ programs
$ gnatmake hello.adb
gcc-4.4 -c hello.adb
gnatbind -x hello.ali
gnatlink hello.ali
$ hello
可以在以下软件包中找到程序“hello”:
* hello
* hello-debhelper
尝试:sudo apt-get install
$ ./hello
bash: ./hello: 权限被拒绝
我该怎么做才能看到程序的输出?
出了什么问题?
一些网站说,只需在“gnatmake hello.adb”之后输入“hello”,但这并没有起作用,
还有一些人说,在“gnatmake hello.adb”之后尝试“./hello”,但这也没有起作用?
接下来怎么办?请帮忙解决。