Page 1 of 1

What is the difference between a binary file on different OS?

Posted: Sun Nov 30, 2025 7:42 am
by AZJIO
If I compiled a program on PureBasic v6.21 on different Linuxes (Arch, Mint, Fedora), how will they differ? The source code is the same and is converted to the same machine code. The files are different, sometimes they don't even run on another OS. Does the compiler import data from the current OS? Why is there such a difference?

Re: What is the difference between a binary file on different OS?

Posted: Sun Nov 30, 2025 8:42 am
by TI-994A
AZJIO wrote: Sun Nov 30, 2025 7:42 amWhy is there such a difference?
Although they all implement the common Linux kernel, each distro is compiled differently, and with different dependencies as well.

So, the toolchains, build configs, graphic systems, etc, would work differently.

Re: What is the difference between a binary file on different OS?

Posted: Sun Nov 30, 2025 8:49 am
by AZJIO
The GTK function call is compiled, but GTK itself is not added to the compiled file.
If you compile a function call, it's not the same as compiling different versions of GTK

Re: What is the difference between a binary file on different OS?

Posted: Sun Nov 30, 2025 9:37 am
by infratec
You can use ldd to see the different needed/used libraries.

Re: What is the difference between a binary file on different OS?

Posted: Sun Nov 30, 2025 2:49 pm
by mk-soft
There are different kernel versions for Linux. Therefore, there are also three different PureBasic versions for Linux.

The programme should therefore be compiled to match the Linux kernel version.
GTK-3 is still available on all versions. This means that the standard functions should run on the target system.

Exceptions may be OpenGL and Movie.
In this case, the missing runtime libraries must be installed on the target system.
Check this with "ldd" on the target system.

Unfortunately, the systray (libappindicator3-1) no longer works with Wayland. However, PureBasic is not alone in this. Other apps no longer work either.

Two different versions are also required for Linux Raspberry. One for Debian 12 and one for Debian 13 because of the WebGadget.
;)

Re: What is the difference between a binary file on different OS?

Posted: Mon Dec 01, 2025 8:57 am
by infratec
The kernel is not guilty :wink:

Else all programs needs to available double if you boot for example with a 5. kernel instead of a 6. kernel after you updated your distribution.

Re: What is the difference between a binary file on different OS?

Posted: Mon Dec 01, 2025 5:50 pm
by mk-soft
infratec wrote: Mon Dec 01, 2025 8:57 am The kernel is not guilty :wink:

Else all programs needs to available double if you boot for example with a 5. kernel instead of a 6. kernel after you updated your distribution.
Okay, the kernel is not to blame.
But usually, after a new kernel is released, there is also a new distribution and new libraries.
In this case, older versions of libraries may be removed.
For example, libwebkit2gtk-4.0 no longer exists in Debian 13.
This means that the programme must be compiled with PB Linux3, which then uses libwebkit2gtk-4.1.