Qt - Cross-compiling on Windows for Linux - windows

I fail to find any instructions on how to cross-compile a Qt app for linux on the windows platform. So could someone give me or link me to step-by-step instructions on how to do so.

Install distcc on your Linux machine. Choose one of the distcc compilers as the compiler Qt will use in the projects pane of Qt Creator. Setup the hosts file for distcc to point at your Windows machine and specify the number of jobs you want to send to it.
On the Windows machine, you have two options - get VirtualBox, and put the same Linux OS on that, or use Cygwin. With either of those options, you can install distcc and get it to listen for incoming tasks from your Linux machine.

Related

What operating systems are supported by Substrate?

I've completed the following tutorial on an Ubuntu server...
https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/setup
I then tried it on a Red Hat distro (CentOS (Red Hat 4.8.5-39)) but it failed to compile.
Prompted me to ask what OS's are supported by Substrate?
Thanks in advance :)
The Getting Started guide lists macOS (BSD), Ubuntu/Debiant, and Arch Linux as preferred distributions. It also says Windows is supported, though not preferred (due to Windows lacking a Bash-style shell by default).
That doesn't mean other distros won't work - if "it failed to compile" then your machine is missing some dependency. The platform is built using Rust (for the service) and JS+npm for the front-end GUI - so it follows that Substrate should run on any platform that Rust (and npm) will run on (i.e. every modern distro of Linux).

What is an "X11 platform" and can it run on windows?

I'm trying to get GtkPlug and GtkSocket to work on Windows 8, using the currently supported GTK3+ windows bundle.
I see in the documentation this note:
The GtkPlug and GtkSocket widgets are only available when GTK+ is
compiled for the X11 platform and GDK_WINDOWING_X11 is defined. They
can only be used on a GdkX11Display. To use GtkPlug and GtkSocket, you
need to include the gtk/gtkx.h header.
What is an X11 platform, and can it be run on windows?
X11 is the graphics platform used by Linux and other Unix-style OSes. It is available for Windows through the Cygwin package but binaries compiled under Cygwin will not run on Windows without Cygwin installed so you probably don't want to go down that path. The documentation is essentially saying "this feature is only available on Linux."

Pyinstaller, how to make 32bit and 64bit .exe on 32bit linux?

I created executable using pyinstaller 2.0 and python2.7 on ubuntu 12.04 32bit (so I assume python is also 32bit).
It's a simple program in console (no gui), that connects to TCP/IP server and send frames.
It works under my ubuntu 32bit, but it does not run on Windows 7 32bit and 64bit.
On Win32bit it returns error "Device is not ready", and on Win64bit it returns error that "application has wrong architecture".
Where can be cause of this?
Here is a link to whole app code (it's small) http://pastebin.com/qj96vpgK
The Linux version of PyInstaller can not make .exes or any non-Linux-native format. In order to make a Windows executable, you need to either use WINE (or at least they say, but I'm not sure how to do that), or use a Windows computer.
Additionally, if the Windows computer you use is 32-bit, it can not make 64-bit binaries. If you have a 64-bit install of Windows, it can make 64-bit binaries easily, but in order to make 32-bit ones, you need to install a 32-bit version of Python (and all the required libraries for your program).
Thus, one way to make both 32- and 64-bit executables for a given program, copy your code over to a Windows 64-bit OS, install the 32 and 64-bit Python and pywin32, and use PyInstaller using each different Python.

Installation script for multiple operating systems

I have to install a C compiler with cilkplus branch which is recently added to the GCC. Since it is recent so I ave to install it manually and there are no direct methods available to that. I plan to install it at custom location. I installed it on a redhat 6 and ubuntu 12.04 successfully but I found that the settings of environment variables are different on both operating systems ( not a surprise ).
For example to install the compiler on ubuntu 12.04 you would need C_INCLUDE_PATH=/usr/lib/x86_64-linux-gnu a directory which does not exist on redhat 6.
I plan to write a single script for installation of this compiler on many systems(different distributions of linux). How can I do it.
One way I can think of is to check which OS and version you are running and set environment variables accordingly but here also I do not know how to do it.
Any other suggestions are also valueable.
Thanks
I would use cmake for easy dependency checking and handling

How to compile a Windows binary in Ubuntu?

I have a Qt application that I can compile in Ubuntu 10.04 64-bit and on Windows. However, I would like to avoid switching to Windows every time I want to compile the Windows version.
Is there a way I can compile a Windows Qt executable in Ubuntu with mingw32 or something?
Further, is there a way to integrate that compiler into Qt Creator?
There is a PPA (Personal Package Archive) for some people who are cross-compiling Qt and related software on Ubuntu for Windows. The PPA contains both the cross-compilers and the dependencies you will need to cross-compile Qt programs. If you look at the source packages there, I think you will be able to figure out how to configure your projects and build them.
If you most of your time spend coding with Qt on Linux (for example, Ubuntu), you may produce some experiment: install Wine, install Qt SDK for Windows with Wine and tried to build some simple project!
And if you don't like crazy things, which I wrote above, just use VirtualBox.

Resources