How to compile a Windows binary in Ubuntu? - windows

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.

Related

Where is Qt Maintenance Tool in Homebrew

I have installed Qt with Homebrew. Everything is working fine for Desktop Application Development. But I do not find Maintenance Tool. Do I need to install that separately with brew ?
It does not exist, since homebrew tries to be a package manager like they exist on linux environtments. Just like cygwin/msys2 for windows. So they provide one qt build and that's it.
You can still install the official binary distribution from Qt which contains the Maintenance Tool. You can think of the Maintenance Tool as Qt's internal package manager, that can install official Qt binaries.

How to minimize install of Qt for using PyQt on MacOS?

I was trying to install PyQt on my MacOS. With SIP installed, an error occurred when python3 PyQt-gpl-5.4/configure.py inputted:
Error: Use the --qmake argument to explicitly specify a working Qt qmake.
It seems that Qt should be installed before PyQt. There're many optional components in the installation of Qt:
-Qt 5.4
--clang 64-bit
--source components
---Add-Ons
---Essentials
--.....
Which components should I choose for installing qmake??
qmake is the executable that is included with any version of the qt libraries; and there is a different version of qmake for each compiler the Qt Libraries are built with/against. On a mac, and for building projects that run on OSX, you will probably want clang x64. And you will find qmake under ~/Qt/5.x/clang_64/bin It will also install qt creator (I don't think you can uncheck it), but you don't need all the extras besides that.
Building with qmake often needs XCode installed and the Command Line Tools (CLT) to use its included compiler. With Python, you probably won't need the compiler, unless you need to build some of its libraries.
Hope that helps.

Cross Debug Win32 Mingw32 C/C++ program on Linux and Wine using GDB

I installed mingw-w64 and gdb-mingw-w64 on Ubuntu 14.10 using:
sudo apt-get install mingw-w64
sudo apt-get install gdb-mingw-w64
I'm able to compile C/C++ programs and run them from Wine or on Windows machine.
I installed mingw32 version of gdb to be able to debug windows app compiled with Mingw.
I tried to use recent versions of Netbeans 8, Code::Blocks 13.12, Eclipse Luna and was able to configure Mingw toolchain to be used with IDE for building win32 application from Linux.
I also tried to configure the same way in those IDEs to use Mingw version of GDB (gdb-mingw-w64) the same way as standrad GDB was sued for non-mingw GCC toolchain but was never able to make it work :(
How can I debug such C/C++ program compiled with Mingw from Linux?
How to configure in any of IDEs listed above?
Thank you!

Installing OpenAL (or a similar package) on W7

I want to install OpenAL Haskell bindings for Windows. When I try cabal install alut I get:
Resolving dependencies...
Configuring OpenAL-1.4.0.2...
cabal: The package has a './configure' script. This requires a Unix
compatibility toolchain such as MinGW+MSYS or Cygwin.
Installing MSYS or Cygwin is absolutely not an option. runghc setup configure on the source yields the same thing. This leads me to the following:
How can I install OpenAL with just an installation of the Haskell Platform? I know mingw comes with the Haskell Platform on Windows. Can I use just that to execute this script?
Is there a package that can play audio that installs with cabal on Windows 7 AND Unix based systems?
The source contains hundreds of directives designed for the configure script, which doesn't work on Windows. Is there a version of the source which is platform specific, ie, the script has already been run in a windows environment?
Edit: Context for the problem:
I have a Haskell program, which among other things, plays sound. It is going to be used for demonstration/interactive presentation to students. The computers in the lab run Windows 7. They have the Haskell Platform installed, but not MSYS or Cygwin. I have about 45 minutes to complete this, which doesn't leave time for the installation of needlessly complex and essentially pointless software. If I could get Windows-compatible source code, I could just distribute it with the program I wrote. All the packages I need besides this one will cabal install just fine; this is also a good introduction to package management.
Edit2: cabal install fails with Cygwin installed, as does runghc setup configure

How to build GCC 4.7 on Windows?

How to build GCC 4.7 on Windows?
You are not finding instructions on how to do this because you cannot natively use gcc in Windows. Your options are either to use gcc through Cygwin [installation instructions] or install the MinGW port [installation instructions].
You can also find links to these projects on the Installing GCC: Binaries page.
Well, gcc 4.7 has not yet been released (it will be released in a few months, i.e. spring 2012).
If your system is Windows then I am sorry for you, Linux is so much better :-) More seriously, you should search for cygwin gcc. I cannot help you in that case.
What did you try? Building GCC (even on Linux) is not an easy task. Some hints (which I guess are also relevant to cygwin & windows).
Always configure and build the compiler in a build tree outside of the source tree. (this is a common mistake).
take care of the many dependencies (and their versions), like the Parma Polyhedra Library, Cloog, etc ...
some features of GCC are not available on Windows. In particular plugins.
I would suppose that installing the binary of an older variant of cygwin gcc (and all the related packages) will help.
But really, I know nothing about Windows. And if you really want a very recent GCC and you cannot install Linux (or build GCC cygwin), you might perhaps consider running Linux in an emulator or virtual machine.

Resources