Find the answer to your Linux question:
Results 1 to 6 of 6
I have to compile my QT and cpp applications and deliver the binary that will run on various distros. Please guide me for following: 1. Which g++ version should I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    9

    Compiler and distro selection for development


    I have to compile my QT and cpp applications and deliver the binary that will run on various distros.

    Please guide me for following:
    1. Which g++ version should I use? (backword compatibility should provide)
    2. Which OS/Distro should I use for development?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,508
    Usually, the gcc collection that comes in your distribution's package manager should be just fine. Myself, I use mostly Red Hat Enterprise Linux 6 or clones (CentOS and Scientific Linux), with the available 4.4.4 compiler suite. I also have the gcc 3.4, 2.95, and 4.6 suites installed for forward/backward compatibility with weird stuff. The gnu compiler suite allows multiple versions to be installed at the same time.

    As for Qt (pronounce "cute"), any gcc suite 3.4 or higher should be fine with current Qt releases. You may need to recompile to run on newer/older distributions - that's why we have virtual machines, so we can build on the targeted distribution. Mostly, the issues are ones of kernel / syscall versions, and shared libraries. For example, if I build a set of libraries and executables on RHEL 6, I can't run them on up-to-date Ubuntu or Fedora distributions, nor on older Red Hat Enterprise ones (like 4.x). Only experimenting can tell you what - again, that's why we use virtual machines...

    FYI, I am a senior engineer at Nokia, still the owner of Qt. How much longer before it is spun off, who knows... At least it is open source, so it will go on, under someone's umbrella likely. Personally, I'd like to see The Linux Foundation take it over if/when Nokia divests itself of it.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    May 2009
    Posts
    9
    Thanks for reply...

    Yes i was looking for the same. I was thinking of compile once and run anywhere, but that not possible right?

    So the solution is that i have to setup compatibility wise gnu compilers and release multiple setup of my application. Is that right?


    Quote Originally Posted by Rubberman View Post
    Usually, the gcc collection that comes in your distribution's package manager should be just fine. Myself, I use mostly Red Hat Enterprise Linux 6 or clones (CentOS and Scientific Linux), with the available 4.4.4 compiler suite. I also have the gcc 3.4, 2.95, and 4.6 suites installed for forward/backward compatibility with weird stuff. The gnu compiler suite allows multiple versions to be installed at the same time.

    As for Qt (pronounce "cute"), any gcc suite 3.4 or higher should be fine with current Qt releases. You may need to recompile to run on newer/older distributions - that's why we have virtual machines, so we can build on the targeted distribution. Mostly, the issues are ones of kernel / syscall versions, and shared libraries. For example, if I build a set of libraries and executables on RHEL 6, I can't run them on up-to-date Ubuntu or Fedora distributions, nor on older Red Hat Enterprise ones (like 4.x). Only experimenting can tell you what - again, that's why we use virtual machines...

    FYI, I am a senior engineer at Nokia, still the owner of Qt. How much longer before it is spun off, who knows... At least it is open source, so it will go on, under someone's umbrella likely. Personally, I'd like to see The Linux Foundation take it over if/when Nokia divests itself of it.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,508
    There are three ways to release Linux apps:

    1. Source code - usually you have a configuration tool that looks at the system and determines if it can be built/run there, and with some options that allow the user/installer to tweak the configuration so it can be built, or tells them what are the missing dependencies may be.
    2. Source distribution packages for the targeted distribitions' package managers.
    3. Binary distribution packages (precompiled) for the targeted distributions' package managers (.rpm, .deb, etc). These will run some dependency checks when an end-user tries to install them on their systems, and either tell them what's missing, or will install the dependent packages.

    All of these options require work on your part. As someone once said, there is no such thing as a "free lunch"...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    May 2009
    Posts
    9
    Ok Thanks!!!

    Suppose I used latest stable compiler and library versions then still i will get compatibility issue in future?


    Quote Originally Posted by Rubberman View Post
    There are three ways to release Linux apps:

    1. Source code - usually you have a configuration tool that looks at the system and determines if it can be built/run there, and with some options that allow the user/installer to tweak the configuration so it can be built, or tells them what are the missing dependencies may be.
    2. Source distribution packages for the targeted distribitions' package managers.
    3. Binary distribution packages (precompiled) for the targeted distributions' package managers (.rpm, .deb, etc). These will run some dependency checks when an end-user tries to install them on their systems, and either tell them what's missing, or will install the dependent packages.

    All of these options require work on your part. As someone once said, there is no such thing as a "free lunch"...

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,508
    Quote Originally Posted by nil_fergi View Post
    Ok Thanks!!!

    Suppose I used latest stable compiler and library versions then still i will get compatibility issue in future?
    Most of the compatibility issues are with shared libraries (DLL Hell as it is known in the Windows universe). The only way to know, is to test, test, test...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •