gnat

Ada - accessibility check raised

落花浮王杯 提交于 2020-04-16 05:50:12
问题 I have downloaded this program from Github: https://github.com/raph-amiard/ada-synth-lib I have attemted the first example and I am presented with an exception. If anybody would be able to give me an insight into why this is, it would be massively appreciated. I've been stumped on this for a long time and I'm really keen to get this working. The error I recieve is: raised PROGRAM_ERROR : waves.adb:110 accessibility check failed Here is the main file: with Waves; use Waves; with Write_To

Why isn't my GNAT's standout file descriptor working?

不羁的心 提交于 2020-01-15 09:06:25
问题 As part of a little project, I'm writing a shell in Ada. As such, when I was investigating the system calls, I learned that there are three ways to do it. The POSIX system calls, which are probably the least reliable. Passing the arguments along to C's system(), which I didn't really want to do, since this was about writing the emulator in Ada and not C. Using GNAT's runtime libraries. I chose to go for the last option, considering this to be the most "Ada-like" of the choices. I found a code

List unused files in Gnat

好久不见. 提交于 2020-01-05 04:13:06
问题 I have a project in GNAT and I would like to list all the files that are never used. I am thinking about doing it with a python script, but, is it possible to do so easily with GNAT? Update: I found about gnatelim, but although in the help it says to have the -P option usage: gnatelim [options] -main=main_unit_name {filename} [-cargs gcc_switches] options: --version - Display version and exit --help - Display usage and exit -Pproject - Use project file project. Only one such switch can be

Ada compiler GNAT on Mac OS

血红的双手。 提交于 2020-01-03 17:01:57
问题 I'm trying to compile ada using the terminal on my mac but I always get this error "error: invalid value 'ada' in '-x ada' " anyone knows how can I fix this? 回答1: You probably don't have an Ada compiler installed, the gcc that comes with OSX does not support Ada. Currently, there are two flavors of free Ada-enabled gcc binaries for OSX: GNAT GPL from AdaCore (select x86_64-darwin as platform). This compiler and the accompanying runtime library are licensed under the GPL, meaning that if you

Error: cannot generate code for file random.ads (package spec)

我与影子孤独终老i 提交于 2019-12-25 09:49:08
问题 I somehow cannot compile (neither run) my Ada code in GPS. I get an error: cannot generate code for file random.ads (package spec) gprbuild: *** compilation phase failed The random.ads file looks like this: with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; package random is protected randomOut is procedure Inicializal; entry Parcel( randomout: out Positive; from: in Positive; to: in Positive := 1 ); private G: Generator; Inicializalt: Boolean := False; end randomOut; task print

GNAT Programming Suite - source file not found

二次信任 提交于 2019-12-25 02:37:29
问题 Ada is still new to me, so I am trying to find my way around the GPS IDE. I asked another question earlier, but I think this problem has precedence over that one, and may be at the root of my trouble. When I compile, I am getting a long list of *warning: source file ... not found" In my .gpr file, I have listed all of the spec and body source files and use the following naming scheme: package Naming is for Casing use "mixedcase"; for Dot_Replacement use "."; for Spec_Suffix ("ada") use "_s

How to write gnatcheck rules

陌路散爱 提交于 2019-12-22 22:19:53
问题 Is it possible to write your own gnatcheck rules, and if so, can someone point me to a good reference? I am searching for a particular "style" that is being used, and would love if I could simply write a rule that says if you see said style, it will throw up a warning, or an error, this way we can flag when this isn't following a particular standard. 回答1: A bit of background may be helpful here. While the style checks hold out a lot of promise for enforcing user style guidelines, that isn't

Dynamically link libgnat

只愿长相守 提交于 2019-12-22 22:17:03
问题 I'm trying to compile a very simple ADA code. Everything works like a charm but on one computer my executable is link dynamically to libgnat whereas on the other computer it's linked statically. In both cases I use gnatmake tool. Any idea why it's happening? Do you know a way to force GNAT to dynamically link libraries? 回答1: That would be the binder's -shared switch. If you are using project files, you can use: project Foo is ... package Binder is for Switches ("Ada") use ("-shared"); end

Ada GPS IDE can't seem to find GtkAda

血红的双手。 提交于 2019-12-22 11:29:57
问题 I have installed both the GNAT Programming Studio (GPS) and GtkAda. They both seem to work fine, but when I try to build the Simple Window project under New Project from Template, I get a bunch of errors saying "file gtk.ads not found." This seems to be a directory/dependency sort of problem - GPS doesn't know where to look for GtkAda. I'm running Windows 7, and have GPS installed at C:\GNAT\2011, and GtkAda installed at C:\GtkAda. I tried adding GtkAda to my PATH; at the moment my PATH user

How do I compile and link using gnatmake with an Ada shared library?

感情迁移 提交于 2019-12-22 08:15:54
问题 I am having trouble compile an applicant again the Florist library. Turns out I have a larger issue with florist (same error results from both newest 2010 Adacore GPL download and 2009 version in Debian's archive). Florist has some low-level issues but when I look through the generated files it seems to be including errno.h correctly. Here is what happens when I build florist: gcc-4.4 -c -I/usr/share/ada/adainclude/florist demo.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr