comp.lang.ada
 help / color / mirror / Atom feed
From: Ada novice <posts@gmx.us>
Subject: Re: Interfacing Ada with C
Date: Sat, 31 Jul 2010 05:19:43 -0700 (PDT)
Date: 2010-07-31T05:19:43-07:00	[thread overview]
Message-ID: <a35aeb9c-3613-4fa3-9219-321b8e551ede@l20g2000yqm.googlegroups.com> (raw)
In-Reply-To: m2hbjgd34f.fsf@pushface.org

On Jul 31, 12:19 am, Simon Wright <si...@pushface.org> wrote:

> Maybe - for Windows - you'll need to change

>    with "../src/ada_math_build";

> to

>    with "..\src\ada_math_build";

Actually, this doesn't seem to make a difference.

- Hide quoted text -
- Show quoted text -

> Oh! that probably wasn't it: you seem to have the structure set up
> differently from what the GPR expects, which is:

>    ./src:
>       ada-numerics-generic_complex_arrays-extensions.adb
>       ada-numerics-generic_complex_arrays-extensions.ads
>       ada_math_build.gpr

>    ./test:
>       test_extensions.adb
>       test_extensions.gpr

> If you go to the 'test' directory in a command window (or whatever it's
> called in Windows now) and say

>    E:\...> gnatmake -p -P test_extensions

> it should go OK. The '-p' says 'create any necessary directories'. I'm
> pretty sure it'll do this in GPS too (it may ask for permission).

I did what you suggested on the command line. This is what I get:

E:\...\jul29\test>gnatmake -p -P test_extensions
object directory "E:\...\jul29\src\.build" created for project
ada_math_build
library directory "E:\...\jul29\src\..\lib" created for project
ada_math_build
object directory "E:\...\jul29\test\.build" created for project
test_extensions
ada_math_build.gpr:15:09: there are no ada sources in this project
gnatmake: "test_extensions" processing failed

Note the ERROR message in the last line. As a result of the above
operations, now I have:

1. a .build directory is created in the folder test and it's empty;
2. a .build directory is created in the folder src and it's empty;
3. a lib folder is also created at the same level of hierarchy as the
folders test and src and it's empty

Afterwards, I'm able to open test_extensions.gpr WITHOUT any warning/
error messages in GPS

So next I tried to compile/build in GPS:

I press "Build main" (i.e. test_extensions.adb) and Ada_Math_Build.gpr
opens up and I get the message:

ada_math_build.gpr : there are no ada sources in this project

Looking at the structure of the gpr files in GPS in the "Project View"
pane on the LHS, I see that we just have 1 file: test_extensions.adb.
The source files Ada.Numerics.Generic_Complex_Arrays-
Extensions.ad(b,s) don't appear.
So there's something wrong. This is why I get the message: there are
no ada sources in this project on compiling.

> >         >>> warning: file name does not match unit name, should be "a-
> > ngcaex.ads"

> From back in the day when GNAT had to run on DOS filesystems, the names
> of units had to be 'krunched' to fit the 8.3 format, and for some reason
> the standard library is still supplied this way. However, the code as
> supplied builds OK with GCC 4.5.0 and GNAT GPL 2010 provided it's
> compiled with ada_math_build.gpr.

> I don't know whether AdaGIDE can manage GPRs, if not you're going to
> have trouble using it for this...

When I had problems earlier opening test_extensions.gpr in GPS as I
mentioned in my earlier post, I tried then to open the source files in
AdaGIDE just to compile them and see if everything is ok for the
source files. But I'm not using AdaGIDE. I will stick to GPS.

> > and I get an error message with
> > Ada.Numerics.Generic_Complex_Arrays.Extensions.adb on compiling:

> > 25.
> >     26. package body Ada.Numerics.Generic_Complex_Arrays.Extensions is
> >         |
> >         >>> descendents of package Ada may not be compiled

> You need special compilation options (-gnatpg) to allow compiling units
> like these which (look as if they) are part of the standard
> library. These options mean too that compilations have to be
> warning-free.

In GPS, I've taken a look at what switch is there for
test_entionsions.gpr and I see -gnatqQ. Changing this to -gnatpg puts
also -gnatVn automaticallt by GPS.

> > Note: for the source files adb and ads the name is ada-numerics-
> > generic_complex_arrays-extensions. Should it be ada-numerics-
> > generic_complex_arrays.extensions (with a dot between "arrays" and
> > "extensions" instead)?

> No, the dash is right:

> ada-numerics-generic_complex_arrays-extensions
> Ada.Numerics.Generic_Complex_Arrays.Extensions

I raised this issue as in the ads and adb files, you wrote:
Ada.Numerics.Generic_Complex_Arrays.Extensions .The dash is not
present. When I copied the plain text files of the codes from SF to
AdaGIDE, then of course, AdaGIDE proposed me the names
Ada.Numerics.Generic_Complex_Arrays.Extensions which match the names
inside the ads and adb files. But then I saw that on your website, you
named them with the dash instead. If I understand correctly, should
the names of the files not match the main procedure or package used
inside an Ada file? Maybe I'm thinking wrong here.

Thanks for giving me suggestions to make it work. We are not yet there
but hopefully with some minor adjustments, everything will be working
fine :).

YC



  reply	other threads:[~2010-07-31 12:19 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-24 11:57 Interfacing Ada with C Ada novice
2010-07-24 12:08 ` Robert A Duff
2010-07-24 12:32   ` Ada novice
2010-07-24 14:52   ` Marco
2010-07-24 16:38 ` Simon Wright
2010-07-24 17:58   ` Ada novice
2010-07-25  8:29     ` Simon Wright
2010-07-25 12:21       ` Ada novice
2010-07-25 13:50         ` Dmitry A. Kazakov
2010-07-25 14:12           ` Ada novice
2010-07-25 14:17             ` Ada novice
2010-07-25 14:26               ` Simon Wright
2010-07-25 16:18                 ` Ada novice
2010-07-25 17:06                   ` Dmitry A. Kazakov
2010-07-25 17:42                     ` Ada novice
     [not found]                     ` <a5ba4513-ce2b-45d1-a5f4-ff1a7945b0b0@q12g2000yqj.googlegroups.com>
2010-07-25 18:26                       ` Dmitry A. Kazakov
2010-07-25 18:52                         ` Ada novice
2010-07-25 18:58                           ` Dmitry A. Kazakov
2010-07-25 19:13                             ` Ada novice
2010-07-25 19:19                               ` Dmitry A. Kazakov
2010-07-25 19:28                                 ` Ada novice
2010-07-25 20:04                                   ` Dmitry A. Kazakov
2010-07-26 13:40                                     ` Ada novice
2010-07-26 14:52                                       ` Dmitry A. Kazakov
2010-07-26 17:14                                         ` Ada novice
     [not found]                                         ` <a2da2804-c19b-44cf-9855-834c602c4520@y11g2000yqm.googlegroups.com>
2010-07-26 17:32                                           ` Dmitry A. Kazakov
2010-07-26 17:50                                             ` Ada novice
2010-07-27 12:24                                               ` Peter Hermann
2010-07-27 19:01                                                 ` Ada novice
2010-07-28  9:56                                                   ` team-ada (was e: " Peter Hermann
2010-07-27  5:50                     ` Ada novice
2010-07-27  7:27                       ` Dmitry A. Kazakov
2010-07-27  7:43                         ` Georg Bauhaus
2010-07-27 18:37                           ` Ada novice
2010-07-27 18:40                         ` Ada novice
2010-07-25 17:24                   ` Simon Wright
2010-07-25 17:47                     ` Simon Wright
2010-07-25 17:58                       ` Ada novice
2010-07-25 23:21         ` Simon Wright
2010-07-26  1:24           ` John B. Matthews
2010-07-26 14:01           ` Ada novice
2010-07-26 15:46           ` sjw
     [not found]           ` <da987804-3948-4871-ab52-4a8e95f06d44@k39g2000yqb.googlegroups.com>
2010-07-26 19:46             ` Simon Wright
2010-07-26 20:39               ` Dmitry A. Kazakov
2010-07-27  5:46                 ` Ada novice
2010-07-27  5:43               ` Ada novice
2010-07-27 17:33                 ` Simon Wright
2010-07-27 18:34                   ` Ada novice
2010-07-28 22:26               ` Simon Wright
2010-07-29  9:19                 ` Ada novice
2010-07-29 19:14                   ` Simon Wright
2010-07-29 20:25                     ` Ada novice
2010-07-30  1:46                     ` John B. Matthews
2010-07-30  9:09                       ` sjw
2010-07-30 12:41                         ` Ada novice
2010-07-30 15:13                           ` John B. Matthews
2010-07-30 17:25                             ` Ada novice
2010-07-30 19:41                               ` John B. Matthews
2010-07-30 21:08                                 ` Ada novice
2010-07-30 22:19                                   ` Simon Wright
2010-07-31 12:19                                     ` Ada novice [this message]
2010-07-31 13:25                                       ` Simon Wright
2010-07-31 19:39                                         ` Ada novice
2010-07-31 21:02                                           ` Simon Wright
2010-08-01  9:36                                             ` Ada novice
2010-08-01 16:14                                               ` Simon Wright
2010-08-01 16:27                                                 ` Ada novice
2010-08-01 17:33                                                   ` Simon Wright
     [not found]                                     ` <997036dd-ca13-4cdf-8f88-9b47a9f83b2d@s9g2000yqd.googlegroups.com>
2010-07-31 13:08                                       ` Simon Wright
2010-07-31 13:17                                         ` Simon Wright
2010-07-30 15:10                         ` John B. Matthews
2010-08-01 10:47                 ` John B. Matthews
2010-08-01 17:08                   ` Simon Wright
2010-08-02  1:08                     ` John B. Matthews
2010-08-02 16:36                       ` Simon Wright
2010-08-02 16:55                         ` Ada novice
2010-08-05  9:14                           ` Ada novice
2010-08-05 13:23                             ` John B. Matthews
2010-08-05 13:57                               ` sjw
2010-08-05 17:24                                 ` Ada novice
2010-08-05 17:59                                   ` Jeffrey Carter
2010-08-05 20:25                                     ` Simon Wright
2010-08-06  1:15                                       ` John B. Matthews
2010-08-06  9:11                                       ` Ada novice
2010-08-06  9:17                                     ` Ada novice
2010-08-06  8:04                                   ` Jacob Sparre Andersen
2010-08-06  8:42                                     ` Dmitry A. Kazakov
2010-08-06  9:26                                       ` Ada novice
2010-08-06  9:51                                         ` Dmitry A. Kazakov
2010-08-06 12:04                                           ` Ada novice
2010-08-06 16:49                                       ` Simon Wright
2010-08-06 17:27                                         ` Dmitry A. Kazakov
2010-08-06 18:15                                           ` Ada novice
2010-08-06 20:26                                           ` Simon Wright
2010-08-07  0:46                                             ` John B. Matthews
2010-08-07  7:59                                               ` Dmitry A. Kazakov
2010-08-07  9:09                                               ` Georg Bauhaus
2010-08-07 12:33                                                 ` John B. Matthews
2010-08-06  9:49                                     ` Peter Hermann
2010-08-06 12:03                                       ` Ada novice
2010-08-07  4:07                                         ` Randy Brukardt
2010-08-07  8:10                                           ` Ada novice
2010-08-06 16:41                                     ` Simon Wright
2010-08-06  8:39                                   ` sjw
2010-07-24 16:44 ` Dmitry A. Kazakov
2010-07-24 18:04   ` Ada novice
2010-07-24 19:16     ` Dmitry A. Kazakov
2010-07-25  0:22     ` tmoran
  -- strict thread matches above, loose matches on Subject: below --
2003-04-14 21:39 Paul Anderson
2003-04-14 23:05 ` tmoran
2003-04-16  2:56 ` Steve
2003-04-16  4:25   ` Steve
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox