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,10706aebb8b707de X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.135.231 with SMTP id pv7mr22865421pbb.8.1329938997585; Wed, 22 Feb 2012 11:29:57 -0800 (PST) Path: wr5ni56298pbc.0!nntp.google.com!news2.google.com!goblin3!goblin2!goblin.stu.neva.ru!newsfeed1.swip.net!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Jan Andres Newsgroups: comp.lang.ada Subject: Re: gnat executables Date: Wed, 22 Feb 2012 19:29:57 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Date: Wed, 22 Feb 2012 19:29:57 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="xXJ3ie/XxBbroS98S2tmyQ"; logging-data="30256"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xS2adJf+IJ+Ay2xtLGBDIPXyertj0nnM=" User-Agent: slrn/0.9.9p1 (Linux) Cancel-Lock: sha1:ndo3sLBi8Ewm21VhB9M1vANN/Zg= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-02-22T19:29:57+00:00 List-Id: On 2012-02-22, tonyg wrote: > On Feb 22, 4:01 pm, "Dmitry A. Kazakov" > wrote: >> On Wed, 22 Feb 2012 07:31:29 -0800 (PST), tonyg wrote: >> > Whenever I compile some code for a different PC , it asks me for the >> > runtime libraries for gtk and some others. Is there a way I can link >> > my executable so the functions used in these libraries are included in >> > my executable ? >> >> You have to link to the static (object) libraries. Whether this would work >> depends on whether the provider of the library allows static linkage or >> not. The answer would depend on the target platform and the licensing >> policy. >> >> -- >> Regards, >> Dmitry A. Kazakovhttp://www.dmitry-kazakov.de > > The librarys are all debian based, things like libgnadecommon and > libgtk, > I was really looking for the command to give to gnatmake, I know - > static option links > in the gnat runtime etc If I understand you correctly you have two options: 1. Instead of -lfoo specify /full/path/to/libfoo.a 2. Something like: -largs -Wl,-Bstatic -lfoo -lbar -Wl,-Bdynamic The latter will switch the linker to static mode, link in the libraries you specify and then switch it back to dynamic linking for the rest of the command line (i.e. the part that gets added automatically for the GNAT runtime etc). Note also that the latter will probably only work on systems that have the GNU linker and you may have to replace -Bstatic and -Bdynamic by something else on other (i.e. non-Linux) OSes.