Cross compilation libraries from Win32 to Linux lazarus / 67-Windows ---------------------------------------------------------------------- regs · 2016-08-29 03:11 having error C:\FPC\3.0.0\bin\i386-Win32\x86_64-linux-ld.exe: cannot find /lib64/ld-linux-x86-64.so.2 File is in folder with all other libraries. It's provided with -FI. Apps cross compiles well, but not libraries. Tried -Xd as suggested in some threads, but still same. Am I missing something? ---------------------------------------------------------------------- Thaddy · 2016-08-29 07:01 What you are missing is that for that platform the internal linker and assembler  will just work. Don't need to specify an internal linker or assembler. What you DO have to do is maybe set some options that are linux specific. like maybe -fPIC and -Tlinux If you want to use un external linker anyway, the options are -FL\path\to\the\linker\ld (capital L, not lowercase l, not -Fl) , use -XP for the binutilsprefix and -FD ---------------------------------------------------------------------- regs · 2016-08-29 07:14 there is a full command line from project options. if i change library to program everything goes well. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  -Tlinux -Px86_64 -MObjFPC -Scghi -Cg -O1 -Xs -l -vewnhibq -Fis:\libtest\lib\linux-x86_64-gtk2 -Flc:\fpc\3.0.0\libraries\linux\x86_64 -FuC:\lazarus- trunk\lcl\units\x86_64-linux\gtk2 -FuC:\lazarus- trunk\lcl\units\x86_64-linux -FuC:\lazarus- trunk\components\lazutils\lib\x86_64-linux -FuC:\lazarus- trunk\packager\units\x86_64-linux -Fus:\libtest\ -FUs:\libtest\lib\linux-x86_64-gtk2\ -FEs:\libtest\bin\ -olibtest.so -dLCL -dLCLgtk2 edit: this indeed did it -FLc:\fpc\3.0.0\libraries\linux\x86_64\ld-linux-x86-64.so.2 ---------------------------------------------------------------------- Fr0sT-Brutal · 2020-07-15 07:21 Quote from: regs on August 29, 2016, 09:14:13 amedit: this indeed did it -FLc:\fpc\3.0.0\libraries\linux\x86_64\ld-linux-x86-64.so.2 Thanks man! You saved me from several hours of frustrating searches in the state of furious rage. I just wonder why the hell it was so complex to find, how the "Use as dynamic linker" is related to "cannot find shared library" error and where this option in Lazarus? Had to add "-FL$(LazarusDir)\..\FPC\lib\$(TargetCPU)-$(TargetOS)\ld-linux.so.2" to Project options => Compiler options => Custom options ---------------------------------------------------------------------- PascalDragon · 2020-07-15 07:34 Quote from: Thaddy on August 29, 2016, 09:01:38 amWhat you are missing is that for that platform the internal linker and assembler  will just work. Don't need to specify an internal linker or assembler. What you DO have to do is maybe set some options that are linux specific. like maybe -fPIC and -Tlinux If you want to use un external linker anyway, the options are -FL\path\to\the\linker\ld (capital L, not lowercase l, not -Fl) , use -XP for the binutilsprefix and -FD Thaddy, that is nonsense. The internal/external linker stuff is about the static linker that the compiler uses to generate the binary. The dynamic linker is what is used by Linux when the executable is run to load libraries it is depending on. Your suggestion to pass a full Windows path using -FL is wrong and will lead to the generated binary not working on Linux if it requires external libraries. Instead the path to the root needs to be supplied using -XR\path\to\root\of\linux\binaries and the dynamic linker (ld- linux-x86-64.so.2) needs to reside in the same subdirectory that it will reside on the Linux system as well (e.g. lib\). ---------------------------------------------------------------------- Thaddy · 2020-07-15 08:19 Quote from: Thaddy on August 29, 2016, 09:01:38 amWhat you are missing is that for that platform the internal linker and assembler  will just work. Don't need to specify an internal linker or assembler. What you DO have to do is maybe set some options that are linux specific. like maybe -fPIC and -Tlinux If you want to use un external linker anyway, the options are -FL\path\to\the\linker\ld (capital L, not lowercase l, not -Fl) , use -XP for the binutilsprefix and -FD I never wrote that. I will change my passwords. (can be checked by ip) ---------------------------------------------------------------------- theo · 2020-07-15 10:56 Quote from: Thaddy on July 15, 2020, 10:19:18 amI never wrote that. I will change my passwords. This post is 4 years old. Why should someone hack your account to write this? ---------------------------------------------------------------------- marcov · 2020-07-15 11:13 Moreover, there is no internal linker enabled for 64-bit Linux, even if it weren't.