I was tasked to develop a Qt windows application. Now, I need to cross-compile this application so that it runs on 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. My Qt 5.12.6 installation supports Red Hat 7.4 as stated in the link bellow.
Now, at some point I had to configure and build my Qt 5.12.6 source to build statically linked executables and avoid the need for an installer. So, I am somewhat familiar with this process.
According to the link bellow I need to setup the development toolchain for the target platform. Configure-options
I tried doing the following on CMD:
cd C:\Qt\Qt5.12.6\5.12.6\Src\
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
However, it fails when "Running configuration tests...". The error I get is something like: Project ERROR: target architecture detection binary not found. The last command it tried to do was:
g++ -c -m64 -W1, -01 -o arch arch.obj
What am I doing wrong?
Do I need to add -device and -device-option CROSS_COMPILE=? If so, what values do I give them? What toolchain do I use to generate a statically linked RedHat 7.4 Linux executable?