comp.lang.ada
 help / color / mirror / Atom feed
* help with include and library files in GPS
@ 2006-02-23 16:00 new
  2006-02-23 18:41 ` Martin Krischik
  2006-02-23 20:33 ` Simon Wright
  0 siblings, 2 replies; 20+ messages in thread
From: new @ 2006-02-23 16:00 UTC (permalink / raw)


I have been using GPS for a while and have not been able to figure out
how to include libraries and include files in GPS.

I have programmed in C for a while and am fimiliar with how it is done
there. There is alway a way to specify search directories for .h files
and compiled library files. I see that there is a way to do this with
gnatmake, but am having trouble finding how to do it from inside GPS.

Any help would be appreciated.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: help with include and library files in GPS
  2006-02-23 16:00 help with include and library files in GPS new
@ 2006-02-23 18:41 ` Martin Krischik
  2006-02-23 21:31   ` new
  2006-02-25 14:38   ` OT: " Steve
  2006-02-23 20:33 ` Simon Wright
  1 sibling, 2 replies; 20+ messages in thread
From: Martin Krischik @ 2006-02-23 18:41 UTC (permalink / raw)


new wrote:

> I have been using GPS for a while and have not been able to figure out
> how to include libraries and include files in GPS.

??? Include ??? We don't include in Ada. we use with and

> I have programmed in C for a while and am fimiliar with how it is done
> there. There is alway a way to specify search directories for .h files
> and compiled library files. I see that there is a way to do this with 
> gnatmake, but am having trouble finding how to do it from inside GPS.

GPS usually uses project files. A project file can with another - library -
project file. The library compiled with that project file becomes then
available to the program. Have a look at how that works:

http://cvs.sourceforge.net/viewcvs.py/adacl/adacl/Scripts/adacl.gpr?view=markup

http://cvs.sourceforge.net/viewcvs.py/adacl/adacl/Scripts/Attic/adacl-tests.gpr?rev=1.1.2.2&only_with_tag=Ada_2005&view=markup

You can also add the good old "-I" option - just like in C - to the compiler
options specified inside the project file.

Martin
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: help with include and library files in GPS
  2006-02-23 16:00 help with include and library files in GPS new
  2006-02-23 18:41 ` Martin Krischik
@ 2006-02-23 20:33 ` Simon Wright
  1 sibling, 0 replies; 20+ messages in thread
From: Simon Wright @ 2006-02-23 20:33 UTC (permalink / raw)


"new" <ajahns@tscwo.com> writes:

> I have been using GPS for a while and have not been able to figure out
> how to include libraries and include files in GPS.
>
> I have programmed in C for a while and am fimiliar with how it is done
> there. There is alway a way to specify search directories for .h files
> and compiled library files. I see that there is a way to do this with
> gnatmake, but am having trouble finding how to do it from inside GPS.
>
> Any help would be appreciated.

If all you want to do is to split up your project into multiple source
directories, check out the Project -> Edit Project Properties ->
Sources dialog.

Many people like to distribute Ada with compiled libraries, personally
I've never been bothered ... just compile the source.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: help with include and library files in GPS
  2006-02-23 18:41 ` Martin Krischik
@ 2006-02-23 21:31   ` new
  2006-02-23 21:49     ` Ludovic Brenta
                       ` (2 more replies)
  2006-02-25 14:38   ` OT: " Steve
  1 sibling, 3 replies; 20+ messages in thread
From: new @ 2006-02-23 21:31 UTC (permalink / raw)


Well thanks, but I am still in confusion. I seem to have figured out
that when I with something in my .gpr it will include that project and
that is what I have to do to include a library. The problem is with I
screw this up, it keeps recompiling the library.

All I am trying to do is use Gtkada with gps. I have succeeded in
installing and compiling Gtkada. I can link with gnatmake on the
command line, but I want to do so in GPS.  I put the directory
containing gtkada.gpr in the ADA_PROJECT_PATH. It still says in cannot
find the library even though libgtkada.a seems to be where it is
supposed to be.

I have put the libgtkada.a everywhere I could thing of but GPS still
says:
gnatmake: no object files for library "gtkada"

Any suggestions?

Another thing is suppose there is a static and dynamic version of the
library. How do I specify which one I want to use? Sometimes GPS says
there is no .dll when I would prefer to use the static library.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: help with include and library files in GPS
  2006-02-23 21:31   ` new
@ 2006-02-23 21:49     ` Ludovic Brenta
  2006-02-24 15:39       ` Simon Wright
  2006-02-24 10:33     ` Stephen Leake
  2006-02-24 18:51     ` Martin Krischik
  2 siblings, 1 reply; 20+ messages in thread
From: Ludovic Brenta @ 2006-02-23 21:49 UTC (permalink / raw)


"new" <ajahns@tscwo.com> writes:
> Well thanks, but I am still in confusion. I seem to have figured out
> that when I with something in my .gpr it will include that project
> and that is what I have to do to include a library. The problem is
> with I screw this up, it keeps recompiling the library.

Make sure that the .ali files for GtkAda are read-only (mode 0444, not
0644) and are present in the object directory of gtkada.gpr.

Remove the object files (*.o) from that directory.

Place libgtkada.a in /usr/lib.

> All I am trying to do is use Gtkada with gps. I have succeeded in
> installing and compiling Gtkada. I can link with gnatmake on the
> command line, but I want to do so in GPS.  I put the directory
> containing gtkada.gpr in the ADA_PROJECT_PATH. It still says in cannot
> find the library even though libgtkada.a seems to be where it is
> supposed to be.

In your project file, reference the exact location of libgtkada.a,
like so:

with "/usr/share/ada/adainclude/gtkada.gpr";
project Blah is
...
   package Linker is
      for Default_Switches ("Ada") use ("/usr/lib/libgtkada.a");
   end Linker;
end Blah;

> I have put the libgtkada.a everywhere I could thing of but GPS still
> says:
> gnatmake: no object files for library "gtkada"
>
> Any suggestions?
>
> Another thing is suppose there is a static and dynamic version of the
> library. How do I specify which one I want to use? Sometimes GPS says
> there is no .dll when I would prefer to use the static library.

with "/usr/share/ada/adainclude/gtkada.gpr";
project Blah is
...
   type Link_Type is ("Static", "Shared");
   Link : Link_Type := External ("Link_Type", "Static");
   package Linker is
      case Link is
         when "Static" => 
            for Default_Switches ("Ada") use ("/usr/lib/libgtkada.a");
         when "Shared" =>
            for Default_Switches ("Ada") use ("-lgtkada");
      end case;
   end Linker;
end Blah;

For full details, see
http://www.ada-france.org/debian/debian-ada-policy.html

HTH

-- 
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: help with include and library files in GPS
  2006-02-23 21:31   ` new
  2006-02-23 21:49     ` Ludovic Brenta
@ 2006-02-24 10:33     ` Stephen Leake
  2006-02-24 18:51     ` Martin Krischik
  2 siblings, 0 replies; 20+ messages in thread
From: Stephen Leake @ 2006-02-24 10:33 UTC (permalink / raw)


"new" <ajahns@tscwo.com> writes:

> Well thanks, but I am still in confusion. I seem to have figured out
> that when I with something in my .gpr it will include that project and
> that is what I have to do to include a library. The problem is with I
> screw this up, it keeps recompiling the library.

Is that a C library, or an Ada library?

There is a bug in gprmake from GNAT 5.03 that causes it to always
recompile C libraries.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: help with include and library files in GPS
  2006-02-23 21:49     ` Ludovic Brenta
@ 2006-02-24 15:39       ` Simon Wright
  2006-02-24 16:18         ` Ludovic Brenta
  0 siblings, 1 reply; 20+ messages in thread
From: Simon Wright @ 2006-02-24 15:39 UTC (permalink / raw)


Ludovic Brenta <ludovic@ludovic-brenta.org> writes:

> In your project file, reference the exact location of libgtkada.a,
> like so:
>
> with "/usr/share/ada/adainclude/gtkada.gpr";
> project Blah is
> ...
>    package Linker is
>       for Default_Switches ("Ada") use ("/usr/lib/libgtkada.a");
>    end Linker;
> end Blah;

(a) the environment variable ADA_PROJECT_PATH tells where to find .gpr
files

(b) you could make your gtkada.gpr define a symbol for the library
path,
   GTKADALIB := ("/usr/lib/libgtkada.a");
and then
     for Default_Switches ("Ada") use gtkada.GTKADALIB;



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: help with include and library files in GPS
  2006-02-24 15:39       ` Simon Wright
@ 2006-02-24 16:18         ` Ludovic Brenta
  0 siblings, 0 replies; 20+ messages in thread
From: Ludovic Brenta @ 2006-02-24 16:18 UTC (permalink / raw)


Simon Wright a écrit :
> (a) the environment variable ADA_PROJECT_PATH tells where to find .gpr
> files

I know, but I generally avoid using environment variables; I put my
build machinery under version control and make sure I can get a
reproducible build from there, without the need for environment
variables. YMMV.

> (b) you could make your gtkada.gpr define a symbol for the library
> path,
>    GTKADALIB := ("/usr/lib/libgtkada.a");
> and then
>      for Default_Switches ("Ada") use gtkada.GTKADALIB;

I already do that for the shared libraries in all Debian packages. I
haven't bothered doing it for the static libraries, since linking
dynamically is so much better - at least in Debian.

-- 
Ludovic Brenta.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: help with include and library files in GPS
  2006-02-23 21:31   ` new
  2006-02-23 21:49     ` Ludovic Brenta
  2006-02-24 10:33     ` Stephen Leake
@ 2006-02-24 18:51     ` Martin Krischik
  2006-02-24 20:42       ` new
  2 siblings, 1 reply; 20+ messages in thread
From: Martin Krischik @ 2006-02-24 18:51 UTC (permalink / raw)


new wrote:

> Well thanks, but I am still in confusion. I seem to have figured out
> that when I with something in my .gpr it will include that project and
> that is what I have to do to include a library. The problem is with I
> screw this up, it keeps recompiling the library.

Yes - when the source are newer then the objects (or ali files) then the
gnat will try to recompile.

It is supposed to help you have a current version compiled all the time -
but from time to time GNAT get's it all wrong. Others have given some
hint's here

Martin
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: help with include and library files in GPS
  2006-02-24 18:51     ` Martin Krischik
@ 2006-02-24 20:42       ` new
  0 siblings, 0 replies; 20+ messages in thread
From: new @ 2006-02-24 20:42 UTC (permalink / raw)


Thanks for all your suggestions. I randomly kept changing things and
all of a sudden it works now, but I still have no idea why. One thing
is that there were two gtkada.gpr files in the distribution and it
worked after I change the withed one and some other stuff.

Now I will see if I can get gtkada to do what I need. 

Thanks.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* OT: Re: help with include and library files in GPS
  2006-02-23 18:41 ` Martin Krischik
  2006-02-23 21:31   ` new
@ 2006-02-25 14:38   ` Steve
  2006-02-26  9:35     ` Martin Krischik
  1 sibling, 1 reply; 20+ messages in thread
From: Steve @ 2006-02-25 14:38 UTC (permalink / raw)


"Martin Krischik" <krischik@users.sourceforge.net> wrote in message 
news:1392397.TMLNCp2Aq0@linux1.krischik.com...
> new wrote:
>
>> I have been using GPS for a while and have not been able to figure out
>> how to include libraries and include files in GPS.
>
> ??? Include ??? We don't include in Ada. we use with and
>
... more non-constructive statements:

  We don't "We" in Ada.
  We don't "don't" in Ada

Please don't confuse an english description of functionality with language 
keywords.  If you feel you must, then throw a smiley at the end of the line 
so everybody will know you're joking.

Ada has object classes.  It doesn't use the "class" keyword to describe 
them, it uses tagged records.  Ada objects have methods.  It doesn't use the 
"method" keyword to describe them, it uses "function" and "procedure".

Steve
(The Duck)

>
> Martin
> -- 
> mailto://krischik@users.sourceforge.net
> Ada programming at: http://ada.krischik.com 





^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: OT: Re: help with include and library files in GPS
  2006-02-25 14:38   ` OT: " Steve
@ 2006-02-26  9:35     ` Martin Krischik
  2006-02-26 13:15       ` Larry Kilgallen
  2006-02-27  2:13       ` Steve
  0 siblings, 2 replies; 20+ messages in thread
From: Martin Krischik @ 2006-02-26  9:35 UTC (permalink / raw)


Steve wrote:

> Please don't confuse an english description of functionality with language
> keywords. ï¿œIf you feel you must, then throw a smiley at the end of the
> line so everybody will know you're joking.

True and I take your advice. However "include" is both a keyword
("#include") and a very low level concept of sharing code between different
compilation units. In fact: the lowest level concept before coping the code
manually from one source file to another.

Anyway: Ada neither uses the keyword nor the concept of include.

Martin
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: OT: Re: help with include and library files in GPS
  2006-02-26  9:35     ` Martin Krischik
@ 2006-02-26 13:15       ` Larry Kilgallen
  2006-02-27  2:13       ` Steve
  1 sibling, 0 replies; 20+ messages in thread
From: Larry Kilgallen @ 2006-02-26 13:15 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

In article <3538707.Le0VB0dQMj@linux1.krischik.com>, Martin Krischik <krischik@users.sourceforge.net> writes:
> Steve wrote:
> 
>> Please don't confuse an english description of functionality with language
>> keywords. �If you feel you must, then throw a smiley at the end of the
>> line so everybody will know you're joking.
> 
> True and I take your advice. However "include" is both a keyword
> ("#include") and a very low level concept of sharing code between different
> compilation units. In fact: the lowest level concept before coping the code
> manually from one source file to another.
> 
> Anyway: Ada neither uses the keyword nor the concept of include.

One might think of With as implementing "strongly typed include" :-)



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: OT: Re: help with include and library files in GPS
  2006-02-26  9:35     ` Martin Krischik
  2006-02-26 13:15       ` Larry Kilgallen
@ 2006-02-27  2:13       ` Steve
  2006-02-27  4:04         ` Jeffrey R. Carter
  2006-02-27 16:48         ` Martin Krischik
  1 sibling, 2 replies; 20+ messages in thread
From: Steve @ 2006-02-27  2:13 UTC (permalink / raw)


"Martin Krischik" <krischik@users.sourceforge.net> wrote in message 
news:3538707.Le0VB0dQMj@linux1.krischik.com...
> Steve wrote:
>
>> Please don't confuse an english description of functionality with 
>> language
>> keywords. If you feel you must, then throw a smiley at the end of the
>> line so everybody will know you're joking.
>
> True and I take your advice. However "include" is both a keyword
> ("#include") and a very low level concept of sharing code between 
> different
> compilation units. In fact: the lowest level concept before coping the 
> code
> manually from one source file to another.
>
> Anyway: Ada neither uses the keyword nor the concept of include.
>

You seem to be very stuck on programming concepts when you're talking about 
include.

Ada certainly does use the concept of include.  If it didn't, you wouldn't 
be able to utilize one package from another.  In Ada it is the "with" 
statement that includes a reference to another packages specification.

Steve
(The Duck)

> Martin
> -- 
> mailto://krischik@users.sourceforge.net
> Ada programming at: http://ada.krischik.com 





^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: OT: Re: help with include and library files in GPS
  2006-02-27  2:13       ` Steve
@ 2006-02-27  4:04         ` Jeffrey R. Carter
  2006-02-27 14:22           ` Larry Kilgallen
  2006-02-27 16:48         ` Martin Krischik
  1 sibling, 1 reply; 20+ messages in thread
From: Jeffrey R. Carter @ 2006-02-27  4:04 UTC (permalink / raw)


Steve wrote:

> Ada certainly does use the concept of include.  If it didn't, you wouldn't 
> be able to utilize one package from another.  In Ada it is the "with" 
> statement that includes a reference to another packages specification.

To me, the concept of "include" is treating the contents of one file as if they 
were textually present in another file at the time of compilation. An Ada 
context clause does not do this.

-- 
Jeff Carter
"I wave my private parts at your aunties."
Monty Python & the Holy Grail
13



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: OT: Re: help with include and library files in GPS
  2006-02-27  4:04         ` Jeffrey R. Carter
@ 2006-02-27 14:22           ` Larry Kilgallen
  2006-02-27 16:25             ` Larry Kilgallen
                               ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Larry Kilgallen @ 2006-02-27 14:22 UTC (permalink / raw)


In article <yTuMf.1309$6I.560@newsread3.news.pas.earthlink.net>, "Jeffrey R. Carter" <spam@spam.com> writes:
> Steve wrote:
> 
>> Ada certainly does use the concept of include.  If it didn't, you wouldn't 
>> be able to utilize one package from another.  In Ada it is the "with" 
>> statement that includes a reference to another packages specification.
> 
> To me, the concept of "include" is treating the contents of one file as if they 
> were textually present in another file at the time of compilation. An Ada 
> context clause does not do this.

To me the concept of "assignment" means copying some bits from here to
there, regardless of whether they beyond.  But Ada has strong typing.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: OT: Re: help with include and library files in GPS
  2006-02-27 14:22           ` Larry Kilgallen
@ 2006-02-27 16:25             ` Larry Kilgallen
  2006-02-27 16:58             ` Martin Krischik
  2006-02-27 18:35             ` Jeffrey R. Carter
  2 siblings, 0 replies; 20+ messages in thread
From: Larry Kilgallen @ 2006-02-27 16:25 UTC (permalink / raw)


In article <9gnvOIcTdKYO@eisner.encompasserve.org>, Kilgallen@SpamCop.net (Larry Kilgallen) writes:
> In article <yTuMf.1309$6I.560@newsread3.news.pas.earthlink.net>, "Jeffrey R. Carter" <spam@spam.com> writes:
>> Steve wrote:
>> 
>>> Ada certainly does use the concept of include.  If it didn't, you wouldn't 
>>> be able to utilize one package from another.  In Ada it is the "with" 
>>> statement that includes a reference to another packages specification.
>> 
>> To me, the concept of "include" is treating the contents of one file as if they 
>> were textually present in another file at the time of compilation. An Ada 
>> context clause does not do this.
> 
> To me the concept of "assignment" means copying some bits from here to
> there, regardless of whether they beyond.  But Ada has strong typing.
                                    belong
                                    belong
                                    belong
                                             And English does not.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: OT: Re: help with include and library files in GPS
  2006-02-27  2:13       ` Steve
  2006-02-27  4:04         ` Jeffrey R. Carter
@ 2006-02-27 16:48         ` Martin Krischik
  1 sibling, 0 replies; 20+ messages in thread
From: Martin Krischik @ 2006-02-27 16:48 UTC (permalink / raw)


Steve wrote:

> You seem to be very stuck on programming concepts when you're talking
> about include.

> Ada certainly does use the concept of include. ï¿œIf it didn't, you wouldn't
> be able to utilize one package from another. ï¿œIn Ada it is the "with"
> statement that includes a reference to another packages specification.

I might be wrong but I see two different concepts: (low level) include and
(high level) import.

C, C++ and Assembler have include.
All other modern high level languages use import. 

As I have learned Modula 2 before learning C I indeed feel deeply on the
difference.

Martin 
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: OT: Re: help with include and library files in GPS
  2006-02-27 14:22           ` Larry Kilgallen
  2006-02-27 16:25             ` Larry Kilgallen
@ 2006-02-27 16:58             ` Martin Krischik
  2006-02-27 18:35             ` Jeffrey R. Carter
  2 siblings, 0 replies; 20+ messages in thread
From: Martin Krischik @ 2006-02-27 16:58 UTC (permalink / raw)


Larry Kilgallen wrote:

> To me the concept of "assignment" means copying some bits from here to
> there, regardless of whether they beyond. ï¿œBut Ada has strong typing.

Well again I see a difference between (low-level) bit-copy and (high level)
assignment. Consider controlled types, deep copy and prehaps packed arrays.

Martin 
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: OT: Re: help with include and library files in GPS
  2006-02-27 14:22           ` Larry Kilgallen
  2006-02-27 16:25             ` Larry Kilgallen
  2006-02-27 16:58             ` Martin Krischik
@ 2006-02-27 18:35             ` Jeffrey R. Carter
  2 siblings, 0 replies; 20+ messages in thread
From: Jeffrey R. Carter @ 2006-02-27 18:35 UTC (permalink / raw)


Larry Kilgallen wrote:

> To me the concept of "assignment" means copying some bits from here to
> there, regardless of whether they belong.  But Ada has strong typing.

If you can't distinguish bitwise copying from assignment, then you probably 
don't understand user-defined assignment. It's not user-defined bitwise copying.

-- 
Jeff Carter
"My legs are gray, my ears are gnarled, my eyes are old and bent."
Monty Python's Life of Brian
81



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2006-02-27 18:35 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-23 16:00 help with include and library files in GPS new
2006-02-23 18:41 ` Martin Krischik
2006-02-23 21:31   ` new
2006-02-23 21:49     ` Ludovic Brenta
2006-02-24 15:39       ` Simon Wright
2006-02-24 16:18         ` Ludovic Brenta
2006-02-24 10:33     ` Stephen Leake
2006-02-24 18:51     ` Martin Krischik
2006-02-24 20:42       ` new
2006-02-25 14:38   ` OT: " Steve
2006-02-26  9:35     ` Martin Krischik
2006-02-26 13:15       ` Larry Kilgallen
2006-02-27  2:13       ` Steve
2006-02-27  4:04         ` Jeffrey R. Carter
2006-02-27 14:22           ` Larry Kilgallen
2006-02-27 16:25             ` Larry Kilgallen
2006-02-27 16:58             ` Martin Krischik
2006-02-27 18:35             ` Jeffrey R. Carter
2006-02-27 16:48         ` Martin Krischik
2006-02-23 20:33 ` Simon Wright

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