Page 1 of 1

ld errors (Linux)

Posted: Thu Dec 25, 2025 8:11 pm
by tcoulon
Hello,

I'm trying to learn PureBasic (previously wrote things in QuickBasic, tcl/tk and RealBasic/Xojo).

I'm having compile problems: I downloaded an "Ubuntu" version (the Debian 12 version is 32bit and has dependancy problems), but I'm running MX Linux (Debian 12 based). Don't know if this is the reason, but when I try to compile I get:

/usr/bin/ld: cannot find -lX11: No such file or directory
/usr/bin/ld: cannot find -lssl: No such file or directory
/usr/bin/ld: cannot find -lcrypto: No such file or directory
collect2: error: ld returned 1 exit status

Searched for such error but found nothing, lx11, lssl don't return anything i can use.

Some hints were in the direction of X11-dev, but this package is installed.

Any suggestion?

Re: ld errors (Linux)

Posted: Thu Dec 25, 2025 8:32 pm
by infratec
You need the Linux (Ubuntu 20.04 or 22.04 - x64) version for Debian 12


Than you can read here for the needed libs for Ubuntu 20.04 or 22.04
viewtopic.php?t=74875

Re: ld errors (Linux)

Posted: Fri Dec 26, 2025 9:40 am
by deeproot
infratec wrote: Thu Dec 25, 2025 8:32 pm You need the Linux (Ubuntu 20.04 or 22.04 - x64) version for Debian 12


Than you can read here for the needed libs for Ubuntu 20.04 or 22.04
viewtopic.php?t=74875
@tcoulon - Infratec is exactly right, for 64-bit MX Linux you need the Ubuntu x64 install as above. To ensure required dependencies - from mk-soft's Simple Install guide just copy&paste each apt-get line into a command terminal.

Sounds like you are running MX 23 Libretto and for that the Ubuntu 20/22 version is correct. The "Debian 12 32-bit" download is only needed for 32-bit MX 23 LInux, which I have on one machine. You can also run the Ubuntu 18 version on MX 23. The Ubuntu 24 version will not work - I think it may on the new MX 25, but I haven't tried it yet.

MX Linux is an excellent choice for developing with PureBasic - works perfectly. I've been using MX since version 16 (and Mepis before that!) - all have run Purebasic with no problem. Good luck and enjoy learning PureBasic!

Re: ld errors (Linux)

Posted: Fri Dec 26, 2025 10:10 am
by eversion
You might also want to double-check that you have the libx11-dev, libssl-dev, andlibcrypto++-dev packages installed specifically for 64-bit. Sometimes even if you have “X11-dev” installed, the linker still can’t find the libraries if they’re 32-bit versions or missing symlinks.

On MX Linux (Debian-based), running something like:

Code: Select all

sudo apt-get install libx11-dev libssl-dev libcrypto++-dev
usually fixes the -lX11 and -lssl / -lcrypto errors. After that, a clean compile should work.

Also, make sure you’re actually using the x64 Ubuntu PureBasic package as suggested—it avoids a lot of weird dependency headaches on MX 23/24fnaf 2