Currently have Mingw32 w/static build, need 64 bit capability

  • Hi I currently have QT set up with mingw32 and a static build with such. I need 64-bit in addition to 32bit compile capability for my program. Also ideally both static builds on the same machine. What's the best / easiest way to achieve this? Should I switch to MSVC since it offers both 32 and 64 bit officially? I found these two guys for 64 bit mingw (are these easy to setup for static building - if so how do I do it?):
    The first refers to RubenVB and the second to Mingw-w64.
    I assume I have to rebuild qt statically as 64 bit in order to compile 64 bit static programs right? What's the best way to approach this - mingw with the custom 64bit builders (does mingw offer an official version?) or is it easier with MSVC? Where can I find instructions on how to do whatever the best solution is ? For MSCV is this up to date ?

  • Have you tried MSYS2?

    MSYS2 is a 64bit suite similar to MinGW but it is based on a more recent fork of CYGWIN. The GNU development tools are currently at 5.4.0 and Qt is at 5.6.0.

    You can install both i686 and x86_64 builds. Your work environment is 64bit so performance is great. You also do not get the overhead of CYGWIN.

    You can use the pakage manager PACMAN to install Qt, QtCreator, gcc, g++, etc. You can go to the following link and get more information:

  • Just to add to what I was saying because somehow I submitted accidentally...
    If you do not wish to use M$VC (as I did), MSYS2 is a good alternative. I am more comfortable using *nix tools over M$ tools so it was a natural fit. Also, since there is NO real debugger support for M$VC without painful installation of CDB debug tools from M$, this was also a plus. GDB/QtCreator is a very nice debugging pair!

  • Thanks for the response. Would you recommend MSYS2 over mingw-w64 or rubenvb? Also how do I integrate with QT Creator and set up another static build this time 64-bit?

  • It is really a personal choice. I use a lot of unix file tools to automate builds and data. MSYS2 offers the full gambit, like Cygwin, without all the /cygdrive/... nonsense. If you use the package manager, pacman, you can install qtcreator and it will work just like the qtcreator you download from with the toolchain automatically populated. You then just have to download the static and shared versions of the Qt API for both the i686 and x86_64 builds.

    NOTE: These may or may not be exact syntaxes because once you have done the initial install, pacman -Sy and pacman -Su synchronizes and updates like DNF or YUM would. Also, the double quotes are just for delimiting the commands. The Qt API version, as stated in earlier posts, is currently 5.6.x. But QtCreator is 4.0.x.

    QtCreator works for Win7, Win8/8.1, and Win10. It will be native 64bit and not native 32bit.

    After doing the initial install, run "pacman -Sy" and then "pacman -Su" from the shell prompt to ensure MSYS2 is up-to-date (this can all be found on the web). You will probably have to remap your shortcuts since they went from using a batch file to run mintty to using mingw32.exe, mingw64.exe, and msys2.exe. The toolchains do not work from the msys2.exe shell. The 32 and 64 mean what you would expect them to mean.

    Now run "pacman -Su mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain". This will install the i686 and x86_64 compiler toolchains.

    Then run "pacman -Ss qt" and you will see a list of all the Qt libraries available. You should see "mingw-w64-x86_64-qt" or something like that. There will also be patterns for i686 and static for both. Usually it is as simple as replacing x86_64 with i686 and adding "-static" on the end.

    To install QtCreator, run "pacman -Su qtcreator" (might just be "creator")

    All MSYS2 executables will be native 64-bit (x86_64) but you can cross-compile i686 applications by selecting the kits in qtcreator. Once everything is installed (which doesn't take too long). I did it in a couple of hours. There will be plenty of choices and options.

    This nicest thing about doing this... you do not have to suffer through building Qt. I leave that to the Qt-pros and choose to be a consumer to free my brain for higher usage of a great API! I hope this helps.

  • Thanks dude I'll give it a go. What exactly does the QT Creator being 4.0 and the API being 5.7.x mean? Does that mean Creator is matched to an older version of the API? I always thought it was just an arbitrary version number for the Creator.

  • Moderators

    @Crag_Hack Yes, QtCreator has its own version number which is not related to Qt version number.

  • @Crag_Hack As @jsulm responded. QtCreator has its own version number. Th Qt API also has its own version number. Designer, the UI form builder, follows the API in versioning to ensure all features map properly.

    I wanted to mention, I updated my MSYS2 last night and the dev toolchain is now at 6.1.0! This defaults to c++14 so you can get as modern as you want in C++ now.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.