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:ae9:dec5:0:b0:762:4579:d6a8 with SMTP id s188-20020ae9dec5000000b007624579d6a8mr1921237qkf.2.1687976726924; Wed, 28 Jun 2023 11:25:26 -0700 (PDT) X-Received: by 2002:a05:6808:2218:b0:3a1:f3b6:434a with SMTP id bd24-20020a056808221800b003a1f3b6434amr2854432oib.4.1687976726626; Wed, 28 Jun 2023 11:25:26 -0700 (PDT) Path: eternal-september.org!news.eternal-september.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!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 11:25:26 -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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9054de21-ec44-479f-adde-a65933cc5e44n@googlegroups.com> Subject: Re: Very basic question: How to use gnatmake (not gprbuild) using external libraries? From: Kenneth Wolcott Injection-Date: Wed, 28 Jun 2023 18:25:26 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3873 Xref: news.eternal-september.org comp.lang.ada:65362 List-Id: On Wednesday, June 28, 2023 at 12:20:09=E2=80=AFAM UTC-7, Jeffrey R.Carter = wrote: > On 2023-06-28 01:44, Kenneth Wolcott wrote:=20 > >=20 > > 1. Where do I place the SDL library from GitHub? > That is up to you. It goes in /path/to/SDL/, where you choose /path/to/. Cool. > > 2. Do I compile/install the package? > The library may have specific compilation/installation instructions. Gene= rally=20 > you should follow those. Ok. > > 3. When using gnatmake do I use -I to specify where the library I'm ref= erencing is found? > This depends on the answer to 2. If you have all the source files for the= =20 > library in /path/to/SDL/, and have compiled them so their .ali and .o fil= es are=20 > also there, then using -I/path/to/SDL/ works fine. This is simple and eas= y. As=20 > S/W engineers always try to keep things as simple as possible, this is th= e=20 > approach I tend to use.=20 Use "-I/path", but do not use "-L/path"? > Coders, on the other hand, like to introduce unnecessary complexity, and = you=20 > will find lots of projects with baroque directory structures, maybe with = source=20 > files in /path/to/SDL/src/, .ali and .o files in /path/to/SDL/lib/, test = program=20 > source files in /path/to/SDL/test/src, their .ali and .o files in=20 > /path/to/SDL/test/lib/, and executables in /path/to/SDL/test/bin/. Such= =20 > directory structures are gnatmake unfriendly, and the simple -I approach = doesn't=20 > work. You'll have to look into the exact meaning of -I and -a, and maybe = others. Yeah, I like to keep things simple as well :-) I'm not sure I understand the distinction between "-I/path" and "-L/path". = I think when one includes ("-I/path") something it will be compiled along = 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? > > 4. Once #3 is answered, I assume that I "with package" as if the '*.ad[= sb]' files were co-located with my Ada program, is that correct? > The Ada language definition is independent of how and where source and=20 > compilation artifacts are stored, so context clauses are necessarily inde= pendent=20 > of such concepts. In other words, yes. This kind of information is handle= d by=20 > the compilation options such as -I.=20 Thank you for the info! Now I will make a new post regarding the compilation error I received with = the SDL package. Thanks, Ken Wolcott > --=20 > Jeff Carter=20 > "He nevere yet no vileynye ne sayde=20 > In al his lyf unto no maner wight."=20 > Canterbury Tales=20 > 156