我怎样才能运行用Ada写的程序呢?

How can I run the program written in Ada?

我正在使用 Windows 10(64 位),我已经从 http://libre.adacore.com/download/configurations#.[=15 下载了 GNAT GPL 2017,ARM ELF 格式(托管在 Windows) =]

我创建了示例代码:

with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
    Put_Line("Hello from GPS!");
end Hello;

当我构建我的文件时,一切都很好并且成功了。问题是,当我 运行 我的程序时,出现错误:

Error while trying to execute C:\Users\sigger\Desktop\ada\hello: not an executable

当我更改 属性 项目时:

Project -> Properties -> Sources -> Main -> Executable names

在 hello.exe 上,然后我得到一个错误,我的程序不能 运行 在 Windows 64 位上。

如何从 Windows 10 上的 ada 代码创建 exe 文件?

"ARM ELF" 是你的问题。如果您尝试在 Windows x86-64 位平台上 运行 ARM 可执行文件,您将不会成功。您需要一个 Windows x86-64(或 Windows x86-32)编译器。

您下载的是一个平台上的 "cross-compiler" - 运行s (Windows 64),但为不同的平台 (ARM) 构建了二进制文件。

在您访问的站点上,尝试 "x86 Windows (32-bit)" 编译器。