2
votes

I'm using Windows 10 (64-bit), I have downloaded GNAT GPL 2017, ARM ELF format (hosted on Windows) from http://libre.adacore.com/download/configurations#.

I have created a sample code:

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

When I build my file everything is fine and it succeed. The problem is, that when I run my program, then get an error:

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

When I change property of my project:

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

on hello.exe, then I get an error, that my program can't run on Windows 64-bit.

How can I create an exe file from my ada code on Windows 10?

1

1 Answers

3
votes

"ARM ELF" is your problem. If you're trying to run an ARM executable on a Windows x86-64 bit platform, you will not succeed. You need a Windows x86-64 (or Windows x86-32) compiler.

What you downloaded was a "cross-compiler" - runs on one platform (Windows 64), but builds binaries for a different platform (ARM).

On the site you went to, try the "x86 Windows (32-bit)" compiler.