1. Where do I place the SDL library from GitHub?
2. Do I compile/install the package?
3. When using gnatmake do I use -I to specify where the library I'm referencing is found?
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?
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/.
2. Do I compile/install the package?The library may have specific compilation/installation instructions. Generally
you should follow those.
3. When using gnatmake do I use -I to specify where the library I'm referencing is found?This depends on the answer to 2. If you have all the source files for the library in /path/to/SDL/, and have compiled them so their .ali and .o files are
also there, then using -I/path/to/SDL/ works fine. This is simple and easy. As
S/W engineers always try to keep things as simple as possible, this is the approach I tend to use.
Coders, on the other hand, like to introduce unnecessary complexity, and you will find lots of projects with baroque directory structures, maybe with source
files in /path/to/SDL/src/, .ali and .o files in /path/to/SDL/lib/, test program
source files in /path/to/SDL/test/src, their .ali and .o files in /path/to/SDL/test/lib/, and executables in /path/to/SDL/test/bin/. Such directory structures are gnatmake unfriendly, and the simple -I approach doesn't
work. You'll have to look into the exact meaning of -I and -a, and maybe others.
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 compilation artifacts are stored, so context clauses are necessarily independent
of such concepts. In other words, yes. This kind of information is handled by
the compilation options such as -I.
--
Jeff Carter
"He nevere yet no vileynye ne sayde
In al his lyf unto no maner wight."
Canterbury Tales
156
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:
That is up to you. It goes in /path/to/SDL/, where you choose /path/to/.
1. Where do I place the SDL library from GitHub?
Cool.
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 linkingstage. Is that correct?
On 2023-06-28 20:25, Kenneth Wolcott wrote:linking stage. Is that correct?
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:
That is up to you. It goes in /path/to/SDL/, where you choose /path/to/.
1. Where do I place the SDL library from GitHub?
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
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.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 44:49:02 |
Calls: | 8,141 |
Calls today: | 4 |
Files: | 13,085 |
Messages: | 5,858,055 |