Got the same error using 12.1.
[DCC Error] E2597 C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\ld-linux.exe: error: cannot find -lz
c:\program files (x86)\embarcadero\studio\23.0\lib\Linux64\debug\System.ZLib.o:System.ZLib:function System::Zlib::deflate(System::Zlib::z_stream&, int): error: undefined reference to 'deflate'
c:\program files (x86)\embarcadero\studio\23.0\lib\Linux64\debug\System.ZLib.o:System.ZLib:function System::Zlib::deflateEnd(System::Zlib::z_stream&): error: undefined reference to 'deflateEnd'
c:\program files (x86)\embarcadero\studio\23.0\lib\Linux64\debug\System.ZLib.o:System.ZLib:function System::Zlib::inflate(System::Zlib::z_stream&, int): error: undefined reference to 'inflate'
c:\program files (x86)\embarcadero\studio\23.0\lib\Linux64\debug\System.ZLib.o:System.ZLib:function System::Zlib::inflateEnd(System::Zlib::z_stream&): error: undefined reference to 'inflateEnd'
c:\program files (x86)\embarcadero\studio\23.0\lib\Linux64\debug\System.ZLib.o:System.ZLib:function System::Zlib::inflateReset(System::Zlib::z_stream&): error: undefined reference to 'inflateReset'
c:\program files (x86)\embarcadero\studio\23.0\lib\Linux64\debug\System.ZLib.o:System.ZLib:function System::Zlib::deflateInit2_(System::Zlib::z_stream&, int, int, int, int, int, char*, int): error: undefined reference to 'deflateInit2_'
c:\program files (x86)\embarcadero\studio\23.0\lib\Linux64\debug\System.ZLib.o:System.ZLib:function System::Zlib::inflateInit2_(System::Zlib::z_stream&, int, char*, int): error: undefined reference to 'inflateInit2_'
[DCC Fatal Error] F2588 Linker error code: 1 ($00000001)
As far as I can work out, ld-linux.exe is a Linux Linker, and it is unable to find some functions in the System.ZLib.o object file.
The source for System.ZLib is located in c:\program files (x86)\embarcadero\studio\23.0\Source\rtl\common\System.ZLib.pas
Looking at the first undefined reference above, deflate is defined in the source file, and the .dcu and .o files are date stamped 24th March 2024, (which I think is possibly when I installed RAD Studio 12.1).
If anyone has encountered and solved this problem, please respond. Meanwhile, I will continue to investigate.
Thanks