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. Cross-compiling a Qt application for Red Hat 7.4 on Windows 10
Qt 6.11 is out! See what's new in the release blog

Cross-compiling a Qt application for Red Hat 7.4 on Windows 10

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 2 Posters 1.2k Views 1 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.
  • C Offline
    C Offline
    CyberCrisis
    wrote on last edited by
    #1

    I have a Qt application for windows, but now I need to cross-compile this application for Red Hat 7.

    I know very little about cross-compiling in general, so I've been doing some research and I saw that you can use the Visual Studio IDE on Windows to create, edit, and debug a C++ project for Linux by having a remote connection to a Linux system, a virtual machine that runs Linux, or a Windows Subsystem for Linux. Unfortunately, our cyber security policies are very strict, so we are not allowed to use any of the three methods previously mentioned. It needs to be done strictly from win10 machine.

    I saw on Qt's website that you can build Qt 5 from the source package and configure it according to your target platform. This is what I have so far:

    configure -prefix C:\Qt\Qt-5.12.6-Static-Linux\ -release -static -no-compile-examples -platform win32-g++ -xplatform linux-g++-64 -recheck-all -v
    

    I tried running this and I got an error about not finding the target architecture binaries.

    Do I need to add -device and -device-option CROSS_COMPILE=? If so, what values do I give them?

    Also, what development toolchain can I use to build Qt for Redhat 7?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You first have to install a proper cross-compiler to do that.

      If memory serves well, you might be able to leverage cygwin for that (but that is from old memories...)

      Another possible option could be to use your CI system to build the application for that target.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      C 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        You first have to install a proper cross-compiler to do that.

        If memory serves well, you might be able to leverage cygwin for that (but that is from old memories...)

        Another possible option could be to use your CI system to build the application for that target.

        C Offline
        C Offline
        CyberCrisis
        wrote on last edited by
        #3

        @SGaist I have Cygwin64 installed at

        C:\cygwin64\
        

        How do I fit cygwin into the Qt configure command from my first question?

        or

        Do I need to run the cygwin terminal, navigate to my project directory and compile my source files from there? If so, does cygwin need to have a linux version of Qt within it?

        What is the right approach?

        I obviously have no clue what is and how Cygwin works; I'll start doing some reading on it.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It's going to be a bit more complicated than that.

          You will first have to build a cross-compiler in order to build from Windows to Linux. There's a Cygwin mkspec that you may be able to leverage once you have the cross-compiler. Note that you may have to cross-compile Qt itself as well as the other dependencies of your application.

          On side note, I haven't used Cygwin for ages so I might not be able to help you as much as I would like.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

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