The scope of this question may be a little bigger than just the Mac, but the specific problem I'm having is with porting some old code to the Mac. I'm a perpetual (20+ years) amateur when it comes to FP, so please bear with me.
(1) The code that uses units: sdl, sdl_ttf, sdl_gfx
(2) Code compiles and runs on Linux, and requires SDL 1.2 libraries
(3) I would like to port this code to Mac
Here is what I've done:
(1) Installed the FPC package for Mac from sourceforge.
fpc -version
[0.023] Free Pascal Compiler version 3.0.4 [2018/09/30] for x86_64
[0.023] Copyright (c) 1993-2017 by Florian Klaempfl and others
[0.023] error: No source file name in command line
[0.023] error: Compilation aborted
Error: /usr/local/bin/ppcx64 returned an error exitcode
(2) The
wiki states:
"For FPC 2.2.2 and later
The SDL unit included with FPC includes all necessary framework, library and main procedure name renaming statements, so you no longer have to do anything special. Just add the sdl unit to your program and everything will be taken care of. However, the remarks about libSDLMain in the above section still hold (libSDLMain.a is required by the SDL unit included with FPC)."However, compiling the code complained about not being able to find/link to SDL 1.2
ld: library not found for -lSDL-1.2.0
(3) So I install the
Runtime libraries. Same result.
ld: library not found for -lSDL-1.2.0
(4) So I download the
source code for the development libraries and try to compile. Run into an issue with not finding X11 headers, so I add:
-I/opt/X11/include
(5) Lastly, I still have the following error that I can't resolve:
./src/video/quartz/SDL_QuartzVideo.h:94:5: error: unknown type name 'CGDirectPaletteRef'
CGDirectPaletteRef palette; /* palette of an 8-bit display */
^
I guess I'm looking for guidance on what to do next. I presume that the problem above is an issue with SDL 1.2 for Mac, and may not even be resolvable in a reasonable way. What should I do? Is there an easy way to get SDL1.2 working with FPC on the Mac these days? Alternatively, if SDL 1.2 is old how can I move onto SDL2 with FPC? Does FPC support this in the same way?