Jump to content
Andrey Kondrashov

Have an Linking error while trying to compile a soap web service for using under linux

Recommended Posts

Hello!

 

Haveing this error while linking a default soap server application for linux. PAS Server was installed under Ubuntu 20.04.2 (maybe it depends on version of linux? where to find a supported list?)

 

[DCC Error] E2597 C:\Program Files (x86)\Embarcadero\Studio\21.0\bin\ld-linux.exe: error: cannot find -lz
  c:\program files (x86)\embarcadero\studio\21.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\21.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\21.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\21.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\21.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\21.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\21.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)

 

what's wrong with it? 

Thank you!

Share this post


Link to post
2 hours ago, Andrey Kondrashov said:

Hello!

...

what's wrong with it? 

Thank you!

My guess would be, that needed additional files are missing or can not be found. For Windows thats often *.obj files wich include the reported method (error: undefined reference to ...X).

Share this post


Link to post

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

Share this post


Link to post

Explanation.

Turns out that when you set up your Linux machine, the instructions should include steps to install PAServer (which you get a clue about when you first try to create a connection profile).
In addition, there is a step to include the zLib-devel library. This bit only seems to matter when you want to to make use of System.zLib in your program to run on Linux.

 

Solution.

This is the documentation for setting up your Linux machine (for Athens). https://docwiki.embarcadero.com/RADStudio/Athens/en/Linux_Application_Development#Preparing_Your_Linux_Machine

Under the heading 'Preparing Your Linux Machine' there are sections for preparing your machine to use zLib under Red Hat and Ubuntu. The second step just says: Update the Local SDK cache. This caused me some confusion, so here is an expanded version of the instruction.

2. Update the Local SDK cache.

2.1 Open Tools | Options | Deployment | SDK Manager

2.2 Select your Linux SDK version from the list.

2.3 Click on 'Update Local File Cache'

 

Incidentally, I found that I had files already in the local cache, and I was being prompted to replace them with older versions. I selected 'Yes to All'.

 

You should now be able to build your project, (assuming there are no other errors to address).

 

Hope this helps - This thread was the only one I found in my Google searches that addressed the specific problem.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×