2,447 questions
0
votes
2
answers
80
views
gcc/g++ compiler with POSIX thread model
I'm on Windows OS and in the past month I used to compile a C/C++ project in Qt Creator IDE using MinGW's gcc/g++ compilers based on POSIX thread model, i.e. compilers that were built with the option -...
3
votes
2
answers
126
views
How to properly constrain two-dimensional array types to be square in Ada?
I'm trying to create a package of generic adjacency matrices to define graphs, and the first goal is to define a static version based on two-dimensional array:
with Ada.Containers.Vectors;
generic
...
0
votes
1
answer
54
views
What is "freezing" and how to declare a vector of variant record type?
I've written the next piece of code in order to declare a vector of lexical elements:
type Lexical_Element_Kind
is (
Delimiter, -- & ' ( ) * + , - . / : ; < = > |
-- => .. ...
1
vote
4
answers
175
views
In Ada 2022, what is the unit for string length?
I cannot find an answerin the reference manual, nor in the sections on strings in the AdaCore tutorials. Is the unit bytes (doubtful for bounded or unbounded strings), code units (pretty sure no), ...
0
votes
3
answers
120
views
Is there a known solution for converting IEEE Float values to Hexadecimal in Ada without using the IEEE package?
I do not have the ability to update our Ada compiler set so include the IEEE packages. Is there a way to convert a Float into a Hexadecimal integer? For instance, a Float value of 1.5 as input should ...
0
votes
1
answer
99
views
"loadImageSVG" linker error when building with Ada Raylib
Hope you an help me, I am attempting to get into simple game development using Ada and the Raylib Ada binding. So far so good, I set everything up through Alire Package Manager, got VS Code to find ...
-1
votes
1
answer
190
views
How to create an executable Ada file with gnatmake
I have an Ada program that calls a C function. I have the C object file. I wrote an small test to see if it works. When I run:
$ gnatmake main.adb -largs cfile.o -lpthread
apparently there's no error ...
3
votes
2
answers
170
views
Better way to organize build (GPR... or gnatmake) [closed]
I'm changing the compiler of a medium-sized codebase, mostly Ada (with some C & C++ modules), from ObjectAda (PTC) to Gnat.
The product consists of ~100 Windows executables and ~20 dlls (~1500 Ada ...
0
votes
2
answers
56
views
User defined log filename in Ada
The following compiles
with Util.Log.Loggers;
package body LogTest is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create("./abc.log");
...
end LogTest;
The problem is ...
2
votes
3
answers
249
views
Print a hex number with leading zeros in Ada
Is there a simple way of printing hexadecimal numbers with leading zeros in Ada? The following will print a number with leading zeros in hex but it is a bit convoluted.
with Interfaces;
with Ada....
1
vote
1
answer
220
views
GNAT Community Edition on Debian Bookworm 12.2
I have installed gnat-2021-20210519-x86_64-linux-bin from
https://www.adacore.com/download
When I tried to build simple project with gprbuild tst.gpr, linking failed with messages
Link
[link] ...
0
votes
2
answers
77
views
How to destroy the button from a GtkAda widget?
"MISSING A callback handler is also needed for the X button when you close the dialog otherwise it never closes and remains in the background." I tried the attached code to solve this, but ...
0
votes
1
answer
126
views
Use switches in the .gpr file for Ada program in community compiler 25.0w
I am compiling a program with "Build & debug" and get the following error message:
[2024-12-12 11:24:45] Could not determine the project for file: D:\ada\project\Sudoku\Sudoku_main.gpr
[...
5
votes
1
answer
130
views
Cannot use `'First` and `'Last` on unbounded strings
When trying to get the first or last index of an unbounded string, as shown in this program
with Ada.Strings; use Ada.Strings; -- for `Backward`
with Ada.Strings.Unbounded;
with Ada.Text_IO; use Ada....
0
votes
1
answer
81
views
How to get the color from GtkAda?
the attached code compile & runs.
$ ./xml_code
Loading of XML is OK
(xml_code:31196): Gtk-CRITICAL **: 22:24:59.048: gtk_color_chooser_get_rgba: assertion 'GTK_IS_COLOR_CHOOSER (chooser)' failed
...
0
votes
1
answer
130
views
How to run a pre build script in gnat project file?
I have a mixed C++ and Ada project.
A GPRbuild project is used to build it and there is no makefile.
There is a script which creates an H file with constants such as build host, username and git ...
0
votes
1
answer
109
views
How to switch off -gnatyt in alr
I've just installed alr on Linux. Haven't used ada for about 10 years and found that gnat community is no longer supported. Entered the following program
with Ada.Text_IO;
procedure A02hello is
...
2
votes
1
answer
122
views
Dynamic Dispatching with Generic Packages in Ada
I am having trouble getting dynamic dispatching to work with Ada generics. Is there an elegant way (something better than conditions such as if X in A then ...) to have the generic Print procedure in ...
0
votes
0
answers
117
views
how to install gtkada on linux
i can't to install gtkada on my Linux PC. I tried look at the adacore's docs but I can't to understand. please someone can help me to install gtkada.i'm really blocked.
after to have download and ...
2
votes
2
answers
142
views
How do I defer the full definition of a type?
Assume I have the following subprogram declared in the specification.
package Waiter is
type Time_Span is ????; -- Time_Span definition TBD...
procedure Wait (Period : Time_Span);
end Waiter;
...
2
votes
2
answers
290
views
Range check failed when using reduction expression in Ada
I tried to convert the array concatenation in function A to the new Ada 2022 reduction expression (see function B), but I get a range check failed error. What am I doing wrong?
with Ada.Text_IO;
...
1
vote
1
answer
100
views
Build the whitakers-words dictionary with Alire
First of all I want to apologize for something wrong I will say, I'm new to Ada and Alire.
I am trying to use the whitakers-words dictionary (https://github.com/mk270/whitakers-words) for a personal ...
5
votes
2
answers
187
views
Array of single bits in ada?
If I wrote
type u1 is range 0 .. 1;
type Index is range 0 .. 499999;
type U1Array is array(Index) of u1;
can I assume, that this will be a bit vector, which is packing the single u1 instances ...
0
votes
1
answer
207
views
How to avoid circular dependencies in Ada?
I have two packages called Passenger and Booking. They have a one to many relationship. I encountered a circular dependency error when I tried to do with in both of their files. I then tried limited ...
0
votes
0
answers
140
views
How to build SSL enabled for Ada Web Server?
I'm trying to get HTTPS requests working with Ada Web Server (AWS) found at https://github.com/AdaCore/aws/tree/master
I'm on Windows 11 and I don't understand how to make a build of the library and ...