Jump to content
@AT

Delphi 13, Linux64 target: linker error E2597

Recommended Posts

I'm trying to build my project fro Linux64 target with 13.0 and building fails with the:

[DCC Error] E2597 C:\Program Files (x86)\Embarcadero\Studio\37.0\bin\ld-linux.exe: error: cannot find -lgcc_s
  C:\Program Files (x86)\Embarcadero\Studio\37.0\bin\ld-linux.exe: error: cannot find -lc
  C:\Program Files (x86)\Embarcadero\Studio\37.0\bin\ld-linux.exe: error: cannot find -ldl
  C:\Program Files (x86)\Embarcadero\Studio\37.0\bin\ld-linux.exe: error: cannot find -lpthread
  C:\Program Files (x86)\Embarcadero\Studio\37.0\bin\ld-linux.exe: error: cannot find -lm
  c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Linux64\\release/libpcre_PIC.a(pcre_globals.o):C:\Projects\Ganymede\tp\runtime\rtl\common\regex\pcre\source\pcre_globals.c:pcre_malloc: error: undefined reference to 'malloc'
  c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Linux64\\release/libpcre_PIC.a(pcre_globals.o):C:\Projects\Ganymede\tp\runtime\rtl\common\regex\pcre\source\pcre_globals.c:pcre_free: error: undefined reference to 'free'
  c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Linux64\\release/libpcre_PIC.a(pcre_globals.o):C:\Projects\Ganymede\tp\runtime\rtl\common\regex\pcre\source\pcre_globals.c:pcre_stack_malloc: error: undefined reference to 'malloc'
  c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Linux64\\release/libpcre_PIC.a(pcre_globals.o):C:\Projects\Ganymede\tp\runtime\rtl\common\regex\pcre\source\pcre_globals.c:pcre_stack_free: error: undefined reference to 'free'
  c:\program files (x86)\embarcadero\studio\37.0\lib\Linux64\debug\SysInit.o:SysInit:function Sysinit::__malloc(unsigned long long): error: undefined reference to 'malloc'
  c:\program files (x86)\embarcadero\studio\37.0\lib\Linux64\debug\SysInit.o:SysInit:function Sysinit::__free(void*): error: undefined reference to 'free'
  c:\program files (x86)\embarcadero\studio\37.0\lib\Linux64\debug\SysInit.o:SysInit:function Sysinit::pthread_once(int&, void (*)()): error: undefined reference to 'pthread_once'
  c:\program files (x86)\embarcadero\studio\37.0\lib\Linux64\debug\SysInit.o:SysInit:function Sysinit::pthread_key_create(unsigned int&, void (*)(void*)): error: undefined reference to 'pthread_key_create'

...

Total 265 linker errors.

 

The Linux SDK (Ubuntu 24.04.x) is shared with the 12.3 and 13.0. and 12.3 continues building the project without issue. All required packages are installed in the Linux instance, PAServer works fine with 13.0.

I was trying to refresh, delete/import SDK, however, the issue is still there.

 

Has anyone see the same issue?

Edited by @AT

Share this post


Link to post

I had same behavior installing the linux only in the setup, then adding windows is working ok

btw. ubuntu should have built-essential installed

 

Edited by RDP1974

Share this post


Link to post

I run on a rake.... :classic_biggrin: I created the issue more than a year ago: https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-1622

My Windows environments uses folders redirection to network location, but Delphi does not work well with UNC paths.

Workaround is to use mapped drives and override System Environment variables to non-UNC form (Drive:\Path).

 

Edited by @AT

Share this post


Link to post

I had this problem with Debian. For those four missing libraries (libc.so, libdl.so, libpthread.so and libm.so), create a soft link from their original names to the needed names.

I opened a shell on my linux machine and did a "sudo find / -name libc.so*", which gave me something like "/usr/lib/.../libc.so.2" (or something like that - I'm working for memory). Then create a soft link "ln -s /usr/lib/.../libc.so.2 /usr/lib64/libc.so". (Check the directory names!).

When you have created the four soft links, go to your linux platform properties in the IDE and refresh.

Share this post


Link to post

Okay. From my linux machine for libc.so:

sudo ln -s /usr/lib/x86_64-linux-gnu/libc.so.6 /usr/lib64/libc.so

Note that -lc expands to libc.so, and similar for the other three libraries.

Share this post


Link to post

As I wrote above - my issue is not related to imported SDK itself.

The issue is in a linker (ld-linux.exe) which does not work correctly with Windows UNC paths.

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

×