From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: GCC conflict on Ubuntu for mixed Ada/C++ project
Date: Wed, 19 May 2010 00:38:46 +0200
Date: 2010-05-19T00:38:46+02:00 [thread overview]
Message-ID: <87y6fgbzt5.fsf@ludovic-brenta.org> (raw)
In-Reply-To: 41d3829e-286d-4894-9140-31343bfa75ac@o12g2000vba.googlegroups.com
zeta_no <olivier_henley@hotmail.com> writes:
> Hi to all,
>
> With the distribution of GNAT GPL form Adacore Libre comes some code
> examples like "ada_cpp" that presents mixed Ada/C++ projetcs. My
> problem is the following: In GPS, for the project to build, we need
> GPRBUILD which uses GCC and the -gnat05 option. Well, using GPRBUILD,
> the ouput of a BUILD ALL tells me that GCC 4.4 installed by Ubuntu was
> triggered, not GCC 4.3 coming with the GNAT distro. How do I tell GPS
> and GPRBUILD to use the good GCC? The problem is on the Ubuntu side or
> GPRBUILD?
>
> We have to admit that my setup is ugly. I use GPS and GPRBUILD from
> Adacore, but GNAT from Ubuntu. That's not all. I don't know why, but
> by using GNAT from Ubuntu, the second example from ada_cpp,
> animals.gpr, does not compile at all. I get the following error
> mesage:
>
> cannot import abstract subprogram "Number_Of_Teeth" declared at line
> 5.
> cannot imp...
>
> If someone could help me with my problem of GNAT versioning to resolve
> the good use of GCC, I would really appreciate. Just to confirm, I
> did exported /usr/gnat/bin into my PATH env. variable.
Out of curiosity I reproduced your problem on Debian with the following
packages installed:
ii gnat 4.4+1 The GNU Ada compiler
ii gnat-4.4 4.4.4-2 The GNU Ada compiler
ii gnat-4.4-base 4.4.4-2 The GNU Compiler Collection (gnat base packa
ii gprbuild 1.3.0-1 a multi-language extensible build tool
ii gprbuild-doc 1.3.0-1 a multi-language extensible build tool
What I did:
$ cp -a /usr/share/doc/gprbuild-doc/examples/ada_cpp .
$ cd ada_cpp
$ make
gprconfig --batch --config Ada,,sjlj --config C++ -o default.cgpr
Creating configuration file: default.cgpr
gprbuild animals.gpr
gcc-4.4 -c -g -gnat05 -gnatwA main.adb
animals.ads:33:24: cannot import abstract subprogram "Number_Of_Teeth" declared at line 5
animals.ads:36:24: cannot import abstract subprogram "Set_Owner" declared at line 10
gprbuild: *** compilation phase failed
make: *** [all] Error 4
As you can see, this has nothing to to with GPS, gnatmake or gprbuild
and everything to do with gnat-4.4.
The version of gprbuild that Stephe packaged for Debian is identical to
that in GNAT GPL 2009, which has new functionality to help interfacing
Ada with C++. gnat-4.4 lacks some of these features; it can iterface
with C++ but in more limited ways. One interesting feature that is new
in GNAT GPL 2009 is the ability to generate an Ada spec file from C++
header files (i.e. g++ -fdump-ada-spec file.h).
If you want to use these latest features, you should use a clean
installation of GNAT GPL 2009; make sure you set your $PATH correctly to
see the GNAT GPL compiler and NOT the Ubuntu compiler.
--
Ludovic Brenta.
prev parent reply other threads:[~2010-05-18 22:38 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-17 3:29 GCC conflict on Ubuntu for mixed Ada/C++ project zeta_no
2010-05-18 7:53 ` Stephen Leake
2010-05-18 13:40 ` zeta_no
2010-05-18 14:39 ` Ludovic Brenta
2010-05-19 9:12 ` Stephen Leake
2010-05-19 9:28 ` Ludovic Brenta
2010-05-19 9:09 ` Stephen Leake
2010-05-18 12:56 ` Ludovic Brenta
2010-05-18 14:12 ` zeta_no
2010-05-18 14:36 ` Ludovic Brenta
2010-05-19 9:16 ` Stephen Leake
2010-05-19 9:22 ` Ludovic Brenta
2010-05-20 10:39 ` Stephen Leake
2010-05-20 12:10 ` Ludovic Brenta
2010-05-24 17:04 ` zeta_no
2010-05-24 21:42 ` zeta_no
2010-05-24 22:45 ` Improving the first contact with Ada (was: GCC conflict on Ubuntu for mixed Ada/C++ project) Ludovic Brenta
2010-06-13 17:26 ` zeta_no
2010-06-13 19:25 ` Improving the first contact with Ada Ludovic Brenta
2010-06-13 19:54 ` Yannick Duchêne (Hibou57)
2010-06-13 20:35 ` zeta_no
2010-06-13 21:22 ` Ludovic Brenta
2010-06-13 22:35 ` Yannick Duchêne (Hibou57)
2010-06-14 8:03 ` Ludovic Brenta
2010-06-14 8:47 ` Nasser M. Abbasi
2010-06-14 9:24 ` Dmitry A. Kazakov
2010-06-14 9:33 ` Ludovic Brenta
2010-06-15 6:48 ` Stephen Leake
2010-06-14 10:39 ` Georg Bauhaus
2010-06-14 12:19 ` Dmitry A. Kazakov
2010-06-14 13:06 ` Georg Bauhaus
2010-06-14 14:29 ` Dmitry A. Kazakov
2010-06-14 15:59 ` Georg Bauhaus
2010-06-14 16:44 ` Dmitry A. Kazakov
2010-06-14 20:34 ` Warren
2010-06-14 9:10 ` Dmitry A. Kazakov
2010-06-29 2:51 ` Randy Brukardt
2010-06-14 8:35 ` Georg Bauhaus
2010-07-06 20:15 ` jonathan
2010-07-06 12:29 ` Improving the first contact with Ada (was: GCC conflict on Ubuntu for mixed Ada/C++ project) Nicholas Collin Paul de Gloucester
2010-07-06 12:57 ` Ludovic Brenta
2010-07-06 13:36 ` Improving the first contact with Ada Georg Bauhaus
2010-05-25 2:26 ` GCC conflict on Ubuntu for mixed Ada/C++ project Stephen Leake
2010-06-13 20:10 ` zeta_no
2010-06-14 20:55 ` Warren
2010-06-15 13:45 ` zeta_no
2010-06-15 15:15 ` Georg Bauhaus
2010-06-15 17:05 ` Niklas Holsti
2010-05-25 2:15 ` Stephen Leake
2010-05-18 22:38 ` Ludovic Brenta [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox