From: Kenneth Wolcott <kennethwolcott@gmail.com>
Subject: Re: Very basic question: How to use gnatmake (not gprbuild) using external libraries?
Date: Wed, 28 Jun 2023 12:34:23 -0700 (PDT) [thread overview]
Message-ID: <ef67f2f3-cbee-4342-9918-2dd12323f4a5n@googlegroups.com> (raw)
In-Reply-To: <u7i03l$1nubt$1@dont-email.me>
On Wednesday, June 28, 2023 at 12:02:16 PM UTC-7, Jeffrey R.Carter wrote:
> On 2023-06-28 20:25, Kenneth Wolcott wrote:
> > On Wednesday, June 28, 2023 at 12:20:09 AM UTC-7, Jeffrey R.Carter wrote:
> >> On 2023-06-28 01:44, Kenneth Wolcott wrote:
> >>>
> >>> 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.
> I probably should have mentioned that the library build procedure may expect a
> specific directory structure under /path/to/SDL/, and failure to create/keep
> that may result in the build process failing.
> > 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?
> From the GNAT user guide
> (https://docs.adacore.com/live/wave/gnat_ugn/html/gnat_ugn/gnat_ugn/building_executable_programs_with_gnat.html#switches-for-gnatmake),
> -I/path/ is equivalent to -aO/path/ -aI/path/. -aO/path/ says to look for
> library and object files (.ali & .o) in /path/ in addition to the current
> directory. -aI/path/ says to look for source files in /path/ in addition to the
> current directory.
>
> -L/path/ is equivalent to -largs -L/path/, so it's a linker switch.
>
> I should probably have mentioned that it's probably a good idea to write-protect
> the library's .ali files one the library is built. This prevents other
> compilations from recompiling the library.
>
> In my experience, if you have the library's source, .ali, and .o files in
> /path/, then -I/path/ is all you need to compile and link against the library.
Thank you for the clarification/elaboration.
Ken
prev parent reply other threads:[~2023-06-28 19:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 23:44 Very basic question: How to use gnatmake (not gprbuild) using external libraries? Kenneth Wolcott
2023-06-28 7:20 ` Jeffrey R.Carter
2023-06-28 18:25 ` Kenneth Wolcott
2023-06-28 19:02 ` Jeffrey R.Carter
2023-06-28 19:34 ` Kenneth Wolcott [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox