From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3d76796391769899 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: GCC conflict on Ubuntu for mixed Ada/C++ project Date: Wed, 19 May 2010 00:38:46 +0200 Organization: A noiseless patient Spider Message-ID: <87y6fgbzt5.fsf@ludovic-brenta.org> References: <41d3829e-286d-4894-9140-31343bfa75ac@o12g2000vba.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Tue, 18 May 2010 22:38:53 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="NictAHOXVUILISf5JGNAaw"; logging-data="28992"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dIoE8fU5ko1XBKhJwxnLX" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:tMoQ0sJQzP0yWxF/mxGvO+veP0M= sha1:OVKZun1GWTqFSFUp8nWKM/nkEqs= Xref: g2news2.google.com comp.lang.ada:11740 Date: 2010-05-19T00:38:46+02:00 List-Id: zeta_no 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.