Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Compile Qt5.7 Apps on CentOS 7 for Distribution on CentOS 5
Forum Updated to NodeBB v4.3 + New Features

Compile Qt5.7 Apps on CentOS 7 for Distribution on CentOS 5

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
3 Posts 3 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jasonevident
    wrote on last edited by
    #1

    Is it possible to compile a Qt app on a CentOS 7 machine that will run on a CentOS 5 machine? Preferably we would be using a commercial license to statically link the application and avoid the necessity of distributing dynamic libraries. I have compiled a hello world application outside of Qt Creator in 7 and ran it fine on 5 (proving the concept is viable) but I have not been able to do the same within Qt. At this point, I am stuck since I have only produced dynamically linked executables that require libraries that are not present on the CentOS 5 machine. Simply copying into place the libraries from CentOS 7 fail, seemingly due to binary incompatibility. Thus, my current attempt is to compile 5.7 with static libraries on CentOS7 in hope that can build something that will run in 5. I feel like there would need to be some compile arguments (ABI???) that would need to be present both when compiling Qt as well as compiling a Qt application in Qt Creator? Any insight on this would be quite appreciated.

    Paul ColbyP 1 Reply Last reply
    0
    • K Offline
      K Offline
      KeithS
      wrote on last edited by
      #2

      Simple answer is no. Qt version 5.x cannot be compiled on CentOS5 as is; some people have managed to get a subset of it to compile but this means building various things like xcb libraries. Qt has an aggressive obsolescence policy towards older OS's.

      Your best bet would be to compile Qt 4.8.7 on a CentOS5 VM and build your app using that.

      1 Reply Last reply
      0
      • J jasonevident

        Is it possible to compile a Qt app on a CentOS 7 machine that will run on a CentOS 5 machine? Preferably we would be using a commercial license to statically link the application and avoid the necessity of distributing dynamic libraries. I have compiled a hello world application outside of Qt Creator in 7 and ran it fine on 5 (proving the concept is viable) but I have not been able to do the same within Qt. At this point, I am stuck since I have only produced dynamically linked executables that require libraries that are not present on the CentOS 5 machine. Simply copying into place the libraries from CentOS 7 fail, seemingly due to binary incompatibility. Thus, my current attempt is to compile 5.7 with static libraries on CentOS7 in hope that can build something that will run in 5. I feel like there would need to be some compile arguments (ABI???) that would need to be present both when compiling Qt as well as compiling a Qt application in Qt Creator? Any insight on this would be quite appreciated.

        Paul ColbyP Offline
        Paul ColbyP Offline
        Paul Colby
        wrote on last edited by
        #3

        @jasonevident said in Compile Qt5.7 Apps on CentOS 7 for Distribution on CentOS 5:

        Is it possible to compile a Qt app on a CentOS 7 machine that will run on a CentOS 5 machine?

        For any project with more-than-trivial dependencies (and the Qt framework is certainly not trivial ;) ) then you'd want to be be looking at Fedora's mock.

        Mock is a tool for building packages. It can build packages for different architectures and different Fedora, RHEL, and Mageia versions than the build host has.

        So, using CentOS 7, mock can build packages for CentOS 5, for example, that link to / depend only on packages provided by CentOS 5.

        Note, although mock is a tool for "building packages" (ie RPMs), it provides the complete build-chain for the target (Fedora/RHEL/CentOS-based) system(s), so you can build just binaries if you want, but I'd recommend you go all the way to RPMs anyway.

        Cheers.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved