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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3b06f2a3754e334e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!news2.volia.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: GPS example fails to compile Date: Fri, 23 Jun 2006 14:59:03 +0200 Message-ID: <4g26poF1lbd6cU1@individual.net> References: <1151050716.409205.237490@y41g2000cwy.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit X-Trace: individual.net Z82X6jDPOk01eIMNGzEUUgjbH5QTpFbzqSenRkB/YPoUU1Fwo= User-Agent: KNode/0.10.2 Xref: g2news2.google.com comp.lang.ada:4924 Date: 2006-06-23T14:59:03+02:00 List-Id: Ludovic Brenta wrote: > Simon Wright a �crit : >> "Xcriber51" writes: >> >> > That's fine, but how does the compiler know where the heck >> > "matrixAlloc" is? I can't see the actual C file where the "matrixAlloc" >> > and similar functions are located included or explicitly referred to in >> > the "matrix_binding.ads" file, either. >> >> Hmm, nor do I. >> >> I know how to tell the linker to use the C .o's; Edit > Project >> Properties > Switches > Ada Linker, at the bottom enter >> >> obj/matrix.o obj/matrix_utils.o >> >> and I can compile the C sources (select the file and Build > Compile >> File) but what I don't see is how to get GPS to do it for itself. >> >> I have to admit to not reading the instructions, though. > > It's in the file scm.gpr: it says "for Languages use ("Ada", "C")" and > the source directories containing both C and Ada source files. It seems > that recent versions of gnatmake have built-in support for C as well as > Ada. I haven't looked any further though. I use Ada plus C plus C++ ;) routinely. You tell the languages in the project file as you say, and enable "multilanguage build" in GPS options. This, translated to command line dudes, means that instead of "gnatmake", another tool is used: "gprmake". It will compile all C and C++ sources in the project folders, create a library with them and link it in the final executable (also the proper linker for C or C++ is called). So, in short: use gprmake with your project files if you're using multilanguage, or enable the corresponding option in GPS.