From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:ad4:59c5:0:b0:635:e771:474d with SMTP id el5-20020ad459c5000000b00635e771474dmr282467qvb.4.1687980863978; Wed, 28 Jun 2023 12:34:23 -0700 (PDT) X-Received: by 2002:a05:6870:4e0e:b0:1b0:7c1a:4a6e with SMTP id pl14-20020a0568704e0e00b001b07c1a4a6emr2544616oab.3.1687980863645; Wed, 28 Jun 2023 12:34:23 -0700 (PDT) Path: eternal-september.org!news.eternal-september.org!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 28 Jun 2023 12:34:23 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=98.59.238.112; posting-account=oHOvdQoAAACYgyEBjgPNvKFOGxg8pNns NNTP-Posting-Host: 98.59.238.112 References: <021a84aa-a34d-4e19-bc14-8643532f001fn@googlegroups.com> <9054de21-ec44-479f-adde-a65933cc5e44n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Very basic question: How to use gnatmake (not gprbuild) using external libraries? From: Kenneth Wolcott Injection-Date: Wed, 28 Jun 2023 19:34:23 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:65365 List-Id: On Wednesday, June 28, 2023 at 12:02:16=E2=80=AFPM UTC-7, Jeffrey R.Carter = wrote: > On 2023-06-28 20:25, Kenneth Wolcott wrote:=20 > > On Wednesday, June 28, 2023 at 12:20:09=E2=80=AFAM UTC-7, Jeffrey R.Car= ter wrote:=20 > >> On 2023-06-28 01:44, Kenneth Wolcott wrote:=20 > >>>=20 > >>> 1. Where do I place the SDL library from GitHub?=20 > >> That is up to you. It goes in /path/to/SDL/, where you choose /path/to= /.=20 > >=20 > > Cool. > I probably should have mentioned that the library build procedure may exp= ect a=20 > specific directory structure under /path/to/SDL/, and failure to create/k= eep=20 > that may result in the build process failing. > > I'm not sure I understand the distinction between "-I/path" and "-L/pat= h". I think when one includes ("-I/path") something it will be compiled alo= ng with what I'm trying to compile and when I use "-L/path" it means use *.= obj, *.ali, etc at the linking stage. Is that correct? > From the GNAT user guide=20 > (https://docs.adacore.com/live/wave/gnat_ugn/html/gnat_ugn/gnat_ugn/build= ing_executable_programs_with_gnat.html#switches-for-gnatmake),=20 > -I/path/ is equivalent to -aO/path/ -aI/path/. -aO/path/ says to look for= =20 > library and object files (.ali & .o) in /path/ in addition to the current= =20 > directory. -aI/path/ says to look for source files in /path/ in addition = to the=20 > current directory.=20 >=20 > -L/path/ is equivalent to -largs -L/path/, so it's a linker switch.=20 >=20 > I should probably have mentioned that it's probably a good idea to write-= protect=20 > the library's .ali files one the library is built. This prevents other=20 > compilations from recompiling the library.=20 >=20 > In my experience, if you have the library's source, .ali, and .o files in= =20 > /path/, then -I/path/ is all you need to compile and link against the lib= rary. Thank you for the clarification/elaboration. Ken