Compile on multiple distros of Linux? lazarus / 32-Linux ---------------------------------------------------------------------- dodgebros · 2025-01-21 00:36 I have Lazarus installed on Linux Mint.  I copied all the project files over from my Lazarus on Windows 7.  Once I compiled my "Windows" Lazarus project files on Linux Mint it worked perfectly on Mint.  BTW i am using the Ubuntu derivative of Mint. As a test I installed the latest workstation version of Fedora in a virtual machine then copied the compiled program file from Mint to Fedora and made it executable.  When I double click on the compiled program file on Fedora, nothing happens. I said all of that to ask this question....does one have to compile the Lazarus project on EACH Linux distro in order to get it to work? Thanks, TD ---------------------------------------------------------------------- TRon · 2025-01-21 01:05 Quote from: dodgebros on January 21, 2025, 01:36:53 amI said all of that to ask this question....does one have to compile the Lazarus project on EACH Linux distro in order to get it to work? No but with some caveats (which probably makes the no answer a theoretical one unless knowing what you're doing). The host platform must provide the dependencies that your application depends on. E.g. if you compiled your program for QT5 widgetset then it will ofc not run on a host that does not cater for that dependency. Furthermore, wayland vs X11 can be an issue and in a similar fashion the version of libc which was build against. The versions of the libraries that you build against are important (the host must be able to handle them). Other than that, in theory, you should be good to go. A GUI application can be invoked from a terminal and usually provide an error on what is missing. Detailed information can be obtained with strace. ---------------------------------------------------------------------- Thaddy · 2025-01-21 05:31 You only have to resolve the dependencies (and compile for the right cpu, of course) Lazarus GUI applications can have *a lot* of dependencies, mainly the widget set. Text mode applications or Daemons have very few to none. The wayland vs X11 warning from TRon is something to be aware of, especially when you are not fully up-to-date:wayland is a moving target. ---------------------------------------------------------------------- dbannon · 2025-01-21 08:28 Guessing you have built a gtk2 app on your linux box, here are the libraries I declare in packaging as necessary for my (gtk2) app - libgtk2.0-0, libcanberra-gtk-module, libnotify-bin, I strongly doubt you need libnotify and you probably don't need libcanberra but my app complains if its not there (runs OK but grizzles).  So, probably, all you need is libgtk2.0-0 ! On fedora, possibly - Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $> sudo dnf install libgtk2.0-0 There was a time when every distro included gtk2 by default but we have been getting signals that it is time to give up on it for some time. Davo ---------------------------------------------------------------------- Handoko · 2025-01-22 02:17 As Windows, programs written using Linux may have library dependency issue. One can use ldd command to check which library is missing. ---------------------------------------------------------------------- dodgebros · 2025-01-23 04:44 Quote from: dbannon on January 21, 2025, 09:28:37 amGuessing you have built a gtk2 app on your linux box, here are the libraries I declare in packaging as necessary for my (gtk2) app - libgtk2.0-0, libcanberra-gtk-module, libnotify-bin, I strongly doubt you need libnotify and you probably don't need libcanberra but my app complains if its not there (runs OK but grizzles).  So, probably, all you need is libgtk2.0-0 ! On fedora, possibly - Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $> sudo dnf install libgtk2.0-0 There was a time when every distro included gtk2 by default but we have been getting signals that it is time to give up on it for some time. Davo That resolved the issue as the app now runs on fedora 41.   Thank you !!! ---------------------------------------------------------------------- HotShoe · 2025-02-19 21:10 You can also see what libraries are absolutely required using : objdump -x filename | grep NEEDED --- Jem ---------------------------------------------------------------------- duralast · 2025-02-19 21:29 Use the OpenSUSE Build Service to use the same source to compile for multiple Linux distros. ---------------------------------------------------------------------- dodgebros · 2025-02-19 21:54 Looks awesome, thank you !!! ---------------------------------------------------------------------- PeterBB · 2025-03-04 22:31 Quote from: duralast on February 19, 2025, 10:29:03 pmUse the OpenSUSE Build Service to use the same source to compile for multiple Linux distros. I was going to mention that too. Example https://build.opensuse.org/package/show/home:PeterBBB/c-evo Builds for 3 versions of Debian, 6 of Ubuntu, Fedora, Mageia from the same source package. Rather ironically, the only build fail is on openSUSE ---------------------------------------------------------------------- dbannon · 2025-03-05 06:43 Peter, I am puzzled, are you building, for example, different binaries for Ubuntu 22.04 and Debian Bookworm ?  I offer users exactly the same deb package for all deb using x86_64 systems (eg), no problems. Certainly looks a useful platform ... Davo ---------------------------------------------------------------------- MarkMLl · 2025-03-05 08:03 Quote from: Handoko on January 22, 2025, 03:17:29 amAs Windows, programs written using Linux may have library dependency issue. One can use ldd command to check which library is missing. The fundamental problem is that the linker generally resolves symlinks to actual library names, so the loader is intolerant of even a trivial version change. It's hardly helped by the fact that Linux doesn't tell you what's actually wrong, just fails silently. OP: if you want to mark the thread or similar, you'll have to edit that into the subject line of the initial posting. MarkMLl ---------------------------------------------------------------------- PeterBB · 2025-03-07 13:58 Quote from: dbannon on March 05, 2025, 07:43:21 am.... are you building, for example, different binaries for Ubuntu 22.04 and Debian Bookworm ?  .... Hi Davo, the executables are different, and the binary packages are not even the same size. Cheers, Peter