Re: Setting up an Ada hello world project



markww wrote:
I finally got a working compiler for windows. However, I'm not quite
sure how to go about compiling a hello world application. The default
project created one source file with the text:
[...]
but the compiler complains that there are no Ada sources in this
project. How do I go about adding an Ada source? I just want to run
something like:

with Ada.Text_IO;

procedure Hello is
begin
Ada.Text_IO.Put_Line("Hello, world!");
end Hello;

You don't need a project file to compile a hello world program. Since you have Gnat you should put that in a file named "hello.adb" and then run "gnatmake hello.adb". This should produce an executable file named "hello.exe".

I think you should let the Gnat project files wait a bit. Right now you can think of them as something GPS uses to store the settings you make. Later, when you're more familiar with Ada, you can start learning what Gnat project files are useful for.

--
Björn Persson PGP key A88682FD
omb jor ers @sv ge.
r o.b n.p son eri nu
.



Relevant Pages

  • Re: Setting up an Ada hello world project
    ... sure how to go about compiling a hello world application. ... How do I go about adding an Ada source? ... I think you should let the Gnat project files wait a bit. ...
    (comp.lang.ada)
  • Re: Fortran module checking
    ... Is it as simple as (mind you I'm using xlf90) ... variable.f psuedocode ... Compiling a source file that USEs a module requires the ...
    (comp.lang.fortran)
  • Re: Fortran module checking
    ... Is it as simple as (mind you I'm using xlf90) ... Compiling a source file that USEs a module requires the ... Ken dot And dot Ann ...
    (comp.lang.fortran)
  • Re: template compile errors
    ... gcc throws some strange linking errors. ... but *not* the stackList.cpp source file ... where to find the function template definitions ... when it is compiling test.cpp?" ...
    (comp.lang.cpp)
  • Re: How to reference custom control from App_Code folder?
    ... I have a custom control that is inside a DLL. ... source file for this DLL in a development folder on my machine, ... I presume that it's not compiling the source file, ...
    (microsoft.public.dotnet.framework.aspnet)