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: 103376,72a4f44afacb49df X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail NNTP-Posting-Date: Sun, 16 Jul 2006 07:29:48 -0500 From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Question on setting up libraries References: <1152998024.669864.21010@35g2000cwc.googlegroups.com> <1230753.DarpVSqsSo@linux1.krischik.com> <1153052044.114830.184030@h48g2000cwc.googlegroups.com> Date: Sun, 16 Jul 2006 14:30:11 +0200 Message-ID: <878xmt3f70.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:9uD18KoLLWtL9SKXTvOkmZQT5YA= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 62.235.236.158 X-Trace: sv3-czu7NoZdOgbOyOYW6AgfhI/QRqh+r201hJO8P8sBDK3UW4yAaVkyykonByTOk5AhhV+zhO5PDDcrGUX!3CS/mQpJQa/3oodU4Oakh7UKYwBZi1O4bOysGD9rvKmodAKDkve1RIj1BR5+ug5yXtxN+/uzS8M= X-Complaints-To: abuse@scarlet.be X-DMCA-Complaints-To: abuse@scarlet.biz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:5727 Date: 2006-07-16T14:30:11+02:00 List-Id: randomm@mindless.com writes: > Wow what a tremendous response! Thanks loads to everyone! I've > bookmarked this thread and I'll go through all of your suggestions. > > Do I understand correctly that the libAdaCurses.a is a run-time type of > library designed to provide dynamic service to an executable that was > bound without including the services in libAdaCurses.a? Then how do I > tell gnatmake that I want to either have a module that I write > completely self-contained or not to include what's in libAdaCurses.a so > that it will branch to it at execution time? No. By convention, files ending with ".a" (for "archive") are static libraries. The linker ("ld") copies part of that archive into your program. Then, your program can the run even if the library isn't there anymore. In contrast, shared libraries have, by convention, the extension .so (for "shared object") on GNU/Linux and most other systems, or .sl ("shared library") on HP/UX. But there is more to it; most often the .so or .sl files are really symbolic links to the actual shared library. You need to know about the "soname" to really understand why. Have a look here: http://www.tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html Windows or OS/2 have "dynamic link libraries" (*.dll) which are roughly equivalent to shared libraries, except they don't have an soname, leading to "DLL hell". If you link dynamically against a shared library, then your program does *not* contain the corresponding object files; it only contains stubs, generated by the linker, which load the shared library and call the subprograms in it. So, the executable file is smaller, and you can replace the shared library with a new version without recompiling or relinking your program. But your program *requires* the presence of a shared library with the right "soname". I believe that that's what you want. > Just a note for anyone who is thinking about using ncurses with Ada, > I think there are some minor but very troublesome problems with the > installation of the 5.5 version. terminal_interface.ads doesn't get > copied to the adainclude library (causing compilation errors) and > neither do *any* of the .o modules. That's the right thing to do. The object files are actually members of the .a "archive". You can try: $ ar tf libAdaCurses.a If GNAT sees object files (.o), it copies them into the final executable, no matter what. In the case of static linking, it does not make a difference, but makes dynamic linking problematic. That's why, for example, the Debian Policy for Ada *forbids* library packages from supplying .o files at all. They must supply the .a static library and the .so shared library instead. > My problems of not knowing enough even what to ask for are > complicated by broken installations! :-) -- Ludovic Brenta.