1

I've recently started using the gnatcoll, gnatcoll_sql, gnatcoll_postgres libraries within GNAT GPS Community Edition.

My default.gpr file looks like this..


with "gnatcoll";
with "gnatcoll_postgres";



project Default is

   for Source_Dirs use ("src");
   for Object_Dir use "obj";
   for Main use ("main.adb");

   package Compiler is
      for Switches ("ada") use ("-gnat12");
   end Compiler;

end Default;

My main file looks like this

with gnatcoll.SQL.Postgres;  use gnatcoll.SQL.Postgres;
with gnatcoll.SQL.Exec;      use gnatcoll.SQL.Exec;
with Ada.Text_IO;            use Ada.Text_IO;


procedure Main is

begin


   Ada.Text_IO.Put_Line("Test");



end Main;

When I Execute I receive the following error message...

gprbuild -d -P/home/parallels/Documents/Ada Projects/Connect to Database 2/default.gpr -XGNATCOLL_OS=unix -XBUILD=PROD -XXMLADA_BUILD=static -XLIBRARY_TYPE=static -XGNATCOLL_CORE_BUILD=static -XGNATCOLL_BUILD=static /home/parallels/Documents/Ada Projects/Connect to Database 2/src/main.adb
gcc -c -gnat12 main.adb
gnatcoll-sql.ads:747:12: aspect identifier expected
gnatcoll-strings_impl.ads:315:10: aspect identifier expected
gnatcoll-strings_impl.ads:318:52: aspect identifier expected
gnatcoll-strings_impl.ads:393:15: aspect identifier expected
gnatcoll-strings_impl.ads:396:51: aspect identifier expected
gprbuild: *** compilation phase failed
[2020-04-22 09:36:12] process exited with status 4, 6% (1/16), elapsed time: 00.75s
[2020-04-22 10:00:24] Could not locate executable on path: xterm

I'm dubious to attempt to alter this code, as it's within the gnatcoll library. Please can anyone advise me if I should alter the code within gnatcoll-strings_impl.ads & gnatcoll-sql.ads Or is there another solution?

I couldn't include the gnatcoll-strings_impl.ads & gnatcoll-sql.ads files below for reference, as they're too large! Here are some screen shots for reference...

enter image description here

enter image description here

enter image description here

Added 29/04/20


Builder results
    /home/parallels/gnatcoll-db/sql/gnatcoll-sql_impl.adb
        30:14 warning: license of withed unit "GNATCOLL.Utils" may be inconsistent
    /home/parallels/gnatcoll-db/sql/gnatcoll-sql_impl.ads
        30:14 warning: license of withed unit "GNATCOLL.Refcount" may be inconsistent
    /home/parallels/opt/GNAT/2019/include/gnatcoll/gnatcoll-atomic.ads
        38:29 "-" not declared in "Atomic_Counters"
        104:37 "=" not declared in "Atomic_Counters"
        97:33 ">" not declared in "Atomic_Counters"
        35:52 "Atomic_Unsigned" not declared in "Atomic_Counters"

Added 02/05/20


[parallels@localhost ~]$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[parallels@localhost ~]$ sudo yum -y install gcc
[sudo] password for parallels: 
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.coreix.net
 * epel: mirrors.coreix.net
 * extras: mirror.netweaver.uk
 * updates: www.mirrorservice.org
Package gcc-4.8.5-39.el7.x86_64 already installed and latest version
Nothing to do
[parallels@localhost ~]$ 

Lloyd Thomas
  • 345
  • 2
  • 12
  • 2
    Those error messages mean, I think, that the compiler doesn’t recognise what it’s looking at as an aspect. All that code is valid: what compiler are you actually using there? I tried it (substituting sqlite for postgres) and CE 2019 was perfectly happy. – Simon Wright Apr 22 '20 at 15:44
  • Thank you for your responce @Simon Wright and for trying this out. I'm using the GNAT GPS Community edition compiler/IDE. Where did you substitue sqlite for postgres? Also what is CE 2019? Cheers :) – Lloyd Thomas Apr 22 '20 at 18:44
  • 1
    GPS is an IDE, not a compiler. CE 2019 is the 2019 Community Edition. GNAT CE *includes* GPS, the compiler, and a buch of other stuff. It’s possible to have version N of GPS run version M of the compiler. Since you’re reporting a problem with the compiler, I’m asking which version of the compiler was used. Add `-v` to the compiler switches. – Simon Wright Apr 22 '20 at 18:51
  • 1
    I replaced postgres by sqlite in both your source files - I did this because macOS comes with sqlite and I don’t want to install a package (postgres) that I don’t use – Simon Wright Apr 22 '20 at 18:52
  • 1
    The only compiler release I can find (from GNAT 2015 up, from FSF GCC 4.8 up) that reports `aspect identifier expected` rather than `"Foo" is not a valid aspect identifier` is FSF GCC 4.9.1 - from 2014 – Simon Wright Apr 24 '20 at 07:06
  • Thank you for your response @Simon Wright, I’m currently having issues with my Mac :( I’m waiting for the OS to arrive on a usb, until then it’s unusable. I look forward to trying your solution as soon as I am able to! Thanks :) – Lloyd Thomas Apr 26 '20 at 15:07
  • Thank you very much @SimonWright I have now tried your solution and it has resolved the problem I was having. However, another error and a couple of warnings have now appeared. I have added this to my original post, as it's too long for this comment. Do you have any idea why this error is there? Thank you for your help. Lloyd – Lloyd Thomas Apr 29 '20 at 07:58
  • Lloyd, that should be a new question. That said, I’m puzzled that `gnatcoll-atomic` ever compiled at all; any compiler after GNAT GPL 2015/FSF GCC 5 seems to have special circuitry to recognise this apparently-illegal code. WHAT COMPILER VERSION ARE YOU ACTUALLY USING? – Simon Wright Apr 29 '20 at 17:11
  • Hi @SimonWright, please see the updated orginal post for the compiler I am using. Thanks – Lloyd Thomas May 02 '20 at 16:26
  • 1
    There you are then. Version 4.8.5 <= version 5. – Simon Wright May 02 '20 at 18:56
  • I'm currently updating to gcc (GCC) 7.3.0 0 - apparently It may take a few hours for the compilation to complete. – Lloyd Thomas May 02 '20 at 18:56
  • Thanks again @SimonWright - I owe you 'another one'! – Lloyd Thomas May 02 '20 at 18:57
  • Hey @SimonWright, the upgrade to 7.3.0 0 has now completed. When I Build & Run within CE 2019 I recieve these errors msgs: `Builder results /home/parallels/gnatcoll-db/sql/gnatcoll-sql.ads 747:12 aspect identifier expected /home/parallels/opt/GNAT/2019/include/gnatcoll/gnatcoll-strings_impl.ads 315:10 aspect identifier expected 393:15 aspect identifier expected 396:51 aspect identifier expected 318:52 aspect identifier expected` If there is anything else I need to do? If so please let me know. Many thanks, Lloyd – Lloyd Thomas May 03 '20 at 18:15
  • @LloydThomas Since the problem changed twice in the course of the comments above, and then nothing more happened for a month, are you still using this question? If not, can you delete it or flag it for removal? I say this because the question's resolution isn't going to help anyone else as far as I can see. – TamaMcGlinn Jun 16 '20 at 18:46

0 Answers0