comp.lang.ada
 help / color / mirror / Atom feed
From: "Alex R. Mosteo" <devnull@mailinator.com>
Subject: Re: GPS example fails to compile
Date: Fri, 23 Jun 2006 14:59:03 +0200
Date: 2006-06-23T14:59:03+02:00	[thread overview]
Message-ID: <4g26poF1lbd6cU1@individual.net> (raw)
In-Reply-To: 1151050716.409205.237490@y41g2000cwy.googlegroups.com

Ludovic Brenta wrote:

> Simon Wright a �crit :
>> "Xcriber51" <xcriber@[OMITTED]> 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. 




  reply	other threads:[~2006-06-23 12:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 20:43 GPS example fails to compile Xcriber51
2006-06-21 20:56 ` Pascal Obry
2006-06-21 21:16   ` Xcriber51
2006-06-21 21:12 ` Gautier
2006-06-22  5:00 ` Jeffrey R. Carter
2006-06-22 11:29 ` Stephen Leake
2006-06-22 22:41 ` Simon Wright
2006-06-23  8:18   ` Ludovic Brenta
2006-06-23 12:59     ` Alex R. Mosteo [this message]
2006-06-23 19:35       ` Xcriber51
2006-06-25 20:41       ` Simon Wright
2006-06-26  6:58         ` Alex R. Mosteo
replies disabled

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