2
votes

I'm trying to learn Ada from Wikibooks. I've downloaded and installed GNAT GPL 2011, created a project in the GPS IDE which comes with it and written an example hello world programme.

The problem I have is that the GPS IDE doesn't bind and link my programme. From here I've found out that gnatbind and gnatlink must be run after gcc. If I do it manually from the command line, the build succeeds and an executable file is correctly generated. But if I click "Build All" in GPS all I get is

gnatmake -d -PD:\path\to\project.gpr
gcc -c -I- -gnatA D:\path\to\hello.adb

[2011-06-23 13:05:17] process terminated successfully (elapsed time: 00.35s)

and only *.o and *.ali files are generated.

How do I make GPS bind and link my app?

3

3 Answers

5
votes

In the Project menu, select "Edit Project Properties". Click the "Main Files" tab. Click the "Add" button.

You'll see a list of the files in your project.

Click the checkbox of the file that contains your main procedure. Just highlighting the line with the filename isn't enough, you have to check the box.

"Okay" your way out of the dialogs.

Now you can build by pressing F4, clicking Build/Project/Build All, or clicking on whichever of those icons is the "Build All" one.

4
votes

You have to tell GPS (or rather gnatmake), which file should be considered the main routine.

This is done in the gpr-file with for Main use ("foo.adb"); or via the project properties in the tab "Main files".

2
votes

Click F4.

That should be the shortcut to "Build Main Number 1". Check your shortcuts in Edit/Key shortcuts/Build

Good luck!