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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f9079c9f0caffeb2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-10 15:29:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!dfw-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3C3E23BB.F2CEA72@Raytheon.com> From: Mark Johnson X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: can Ada be linked dynamically ?? References: <3C3DA90C.460DF95A@champagnierle.de> <3C3DB2D4.9B1F1263@Raytheon.com> <3C3DEB86.DB3214A2@champagnierle.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 10 Jan 2002 17:28:59 -0600 NNTP-Posting-Host: 192.27.48.44 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.raytheon.com 1010705349 192.27.48.44 (Thu, 10 Jan 2002 17:29:09 CST) NNTP-Posting-Date: Thu, 10 Jan 2002 17:29:09 CST Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:18748 Date: 2002-01-10T17:28:59-06:00 List-Id: Marc Neininger wrote: > > > Yes, No, Maybe. It depends on which system you are using. > I'm using LINUX with the normal gnat compiler > > > You need to be a LOT more specific on which target system, which > > compiler, and other relevant information before anyone can give you a > > helpful reply. I also assume you really want to know "HOW" to do this, > > not just can it be done. > > ... Thanx for this fast answer. So generally spoken it is possible. > Target systems would be Windows and Linux. > > We are using typically gnat on Linux and Adagide on Windows (think it > also works with the gnat compiler). >From the GNAT user's guide (assuming Linux)... ... For simple libraries, it is also possible to create a dummy main program which depends upon all the packages that comprise the interface of the library. This dummy main program can then be given to gnatmake, in order to build all the necessary objects. [dummy program not included] gnatmake -c my_lib_dummy.adb rm my_lib_dummy.o my_lib_dummy.ali ar rc libmy_lib.a *.o gcc -shared -o libmy_lib.so *.o to generate both the static and dynamic library for the packages referenced by "my_lib_dummy". I assume you know how to refer to a separate library in linking. In addition, to use the library, you need to provide the following source files... - the specs of all packages that make up the visible part of the library - all sources upon which the visible parts depend - the bodies of all visible generic units For example, if you use pragma Inline for a function, you must provide the body for that function. It is recommended (but not mandatory) to include ALL source files used in the library - to aid the user in debugging. The user's guide has more details and other examples. I can't comment on the same steps on Windows; perhaps someone else can. --Mark