3

Hello I'm a beginner using Ada and I already installed GNAT Studio and I really wanted to create a simple GUI but I don't have any idea on how to Install GtkAda. I'm trying to look videos on Youtube but unfortunately, there was nothing. Also I don't really understand the guide on docs.adacore.com

Amben Uchiha
  • 431
  • 2
  • 10
  • 3
    Assuming that you've installed the community edition of GNAT, the best starting point is to download the GtkAda installer [here](https://www.adacore.com/download/more) (Windows/Linux) and follow the instructions. For Windows: just run the installer, for Linux, unpack the gzip'ed tar and then run the executable. The library will be build during the installation so a GNAT compiler must be available. One thing to pay particular attention to is that you need to add a path to the environment before you can start developing with the library. Details are given at the end of the installation. – DeeDee Mar 31 '21 at 15:55
  • @DeeDee Where can I locate the compiler location? The installer prompts me to enter the compiler location and I put it to C:\GNAT however it still does not locate the compiler – Amben Uchiha Mar 31 '21 at 17:59
  • 1
    The compiler (and other build tools) are typically located in "C:\GNAT\2020\bin" (for GNAT community edition 2020). It is recommended to add this folder to the path environment variable. – DeeDee Mar 31 '21 at 18:23
  • @DeeDee Thank you very much it worked :) – Amben Uchiha Mar 31 '21 at 18:58

1 Answers1

1

If you installed the GNAT Community Edition 2021 from https://www.adacore.com/download/more then download gtkada from the same page selecting Linux or Windows (Mac is not available). For Windows the gtkada package is a visual installer you can directly run. For Linux you need to unpack it and build it.

Alternatively, better than the deprecated GNAT Community Edition 2021 is to use the Alire package manager, just install a new GNAT Studio from https://github.com/AdaCore/gnatstudio/releases (click con the Assets link for downloading the installers) and the installer Alire from https://alire.ada.dev/ (this should work for Mac too).

Once you have Alire in place and the new GNAT studio installed and in the PATH environment just run these commands:

alr init --bin hola_gtk
cd hola_gtk
alr with gtkada

The first time running these commands will take long installing all the dependencies, be patience

Then run alr edit inside your new project and add GTK new code as the tutorials at https://docs.adacore.com/gtkada-docs/gtkada_ug/_build/html/intro.html and when ready just run alr run

IMPORTANT: ensure you install GNAT, Alire and event your current user home at directories WITHOUT whitespaces (most of this tooling assumes old Unix based paths like /opt/gnat, /home/user1, etc.) ... whitespaces will produce nasty weird errors

Carlos Saltos
  • 1,385
  • 15
  • 15