Qt with MinGW-64 kit built-in...



  • This question may have already been answered. I did a search and couldn't find the info I needed so if it already exists I deeply apologize. Does Qt plan on creating a 64-bit MinGW built-in kit anytime soon? I really love the MinGW compiler, and I want to do 64 bit programming. But I can't seem to get the MinGW-64 compiler (v5.2) setup to use correctly in Qt. I'm good at coding but suck at setting up compilers in an IDE. So, I need them precondigured if I want to do any coding. Any hints on when Qt might come with a 64-bit MinGW kit? Or... possibly some screen shots of the settings to get Mingw-64 5.2 to work in Qt?

    Thanks in advance!



    1. Install Perl;
    2. Install Python 2.7;
    3. Install Ruby;
    4. Install MinGW-w64
      Qt (static link) building with MinGW-w64 compiler ends successfully only with this *.bat (run from MinGW-w64 environment (non cygwin or msys2)):
    SET _CD=%CD%
    SET _PATH=%PATH%
    
    SET QT_SOURCE=%_CD%\qt-everywhere-opensource-src-5.5.1
    SET QT_BUILD=%_CD%\mingw_w64_objs
    SET QT_DIST=%_CD%\mingw64_Static
    
    REM Building Qt
    
    SET PATH=C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;%QT_SOURCE%\qtbase\bin;%QT_SOURCE%\gnuwin32\bin;c:\python27\;%PATH%;
    CALL C:\Ruby22-x64\bin\setrbvars.bat
    ECHO ON
    PATH
    PAUSE
    
    MKDIR %QT_BUILD%
    CD /D %QT_BUILD%
    PAUSE
    CALL %QT_SOURCE%\configure.bat -prefix %QT_DIST% -debug-and-release -static -opensource -confirm-license -no-icu -nomake tests -opengl desktop -no-compile-examples -no-plugin-manifests -no-audio-backend -no-native-gestures -skip qtandroidextras -skip qtactiveqt -skip qtconnectivity -skip qtdeclarative -skip qtlocation -skip qtmacextras -skip qtquick1 -skip qtquickcontrols -skip qtscript -skip qtsensors -skip qtserialport -skip qtwebengine -skip qtwebchannel -skip qtwayland -skip qtwebkit -skip qtwebkit-examples -skip qtwebsockets -skip qtx11extras -developer-build
    ECHO ON
    PAUSE
    mingw32-make
    

    If you need dinamic link library (dll in windows) delete "-static" key in configure.
    Remember: MinGW and MinGW-w64 are differrent compilers!
    No problems.



  • Not quite what I was looking for (and I'm more confused now) but thanks just the same. :)


  • Moderators

    @GypsyPrince said:

    This question may have already been answered. I did a search and couldn't find the info I needed so if it already exists I deeply apologize.

    That's OK :) https://forum.qt.io/topic/53583/why-no-windows-mingw64-build-in-downloads-section/3

    Does Qt plan on creating a 64-bit MinGW built-in kit anytime soon?

    No, as explained in the link I posted above.

    But I can't seem to get the MinGW-64 compiler (v5.2) setup to use correctly in Qt.... Or... possibly some screen shots of the settings to get Mingw-64 5.2 to work in Qt?

    Your compiler and library DLLs need to match.

    Changing some settings is not enough. If you want to use your 64-bit MinGW compiler to build Qt apps, then you must first use your 64-bit MinGW compiler to build the Qt DLLs. (That's what @ZenitFan219 's instructions are trying to show you)

    Alternatively, you need to get those DLLs from someone who has already built them. The link I posted above used to point to a ready-made package for 64-bit MinGW + Qt, but sadly that link is now dead. The following site still has some valid packages, but they only go up to Qt 5.2.1: https://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/Qt-Builds/



  • @GypsyPrince

    Using Qt+MinGW-w64 (windows, not cygwin/msys2) is possible, but in this variant you must build Qt Libraries with this compiler.
    Look my previous answer. If you don't want to build Qt DLL's I can help you. For example, I can send built Qt(5.5.1) Libraries (Qt(5.5.1) Libraries were built by *.bat file in previous answer) with qtbinpatcher (needs to distribute or replace built Qt folder).



  • Unfortunately, my ignorance is the result of being trained on C++ in the pre-configured world of MS Visual Studio - safe from the harsh realities of toolchains. LOL

    But, I guess I have to learn this scary stuff at some point if I want to keep using Qt and I can expect other people to continue building them for me. Before beginning, is it actually necessary that I install Perl, Python, and Ruby in order to compile the DLLs I need? Or were those just personal preferences?



  • @GypsyPrince
    Ruby, Perl, Pyrhon v2.7 (only this version!!!) are required to build Qt Libraries (ONLY to build!!!).
    I have a question:

    1. What compiler do you want to use: MinGW-w64 or MSVC++ (Microsoft Visual C/C++ from Visual Studio)?

    PS: I'm sorry for my not good English language..


  • Moderators

    @ZenitFan219 said:

    Ruby, Perl, Pyrhon v2.7 (only this version!!!) are required to build Qt Libraries (ONLY to build!!!).

    Python and Perl are required to build Qt.

    Ruby is only required if you want to build Qt WebKit (which is deprecated). But if you want to build Qt WebKit, then you also need bison, flex, gperf, and ICU.

    See http://wiki.qt.io/Building_Qt_5_from_Git



  • @ZenitFan219

    I'd like to use MinGw-64 v5.3. I don't want the GNU-GCC compiler even though they're cut from the same cloth. And if I'm going to use the Microsoft Visual C++ compiler, I might as well keep using VS.

    Now, this creates another question for me:

    Can I develop cross-platform apps for iOS and Linux in Qt using the MS C++ compiler? If so, I can just install the MSC++ compiler with Qt.
    I'm guessing however, that the answer is no.

    I failed to mention in my original post that I want to build both 64-bit and cross platform apps. So, if I want to use Qt, is my only choice to make a special compilation of its libraries with MinGW-64?

    Thanks!


  • Moderators

    @GypsyPrince said:

    Can I develop cross-platform apps for iOS and Linux in Qt using the MS C++ compiler? If so, I can just install the MSC++ compiler with Qt.
    I'm guessing however, that the answer is no.

    No.

    For iOS, you can't even use a Windows computer; Apple requires you to use an OS X computer.

    I failed to mention in my original post that I want to build both 64-bit and cross platform apps.

    Qt lets you create cross-platform apps by making your source code platform-agnostic. That means, you can use the same source code to produce apps for different platforms. However, you still need to use a dedicated compiler for each platform and have a dedicated copy of the Qt libraries for each platform.

    For example, let's say your development PC is Ubuntu (Linux), and you want to create cross-platform apps that run on Linux, Windows, and Android. That means, you need 3 different compilers and 3 different copies of the Qt libraries on your PC. However, you probably only need 1 copy of your source code.

    So, if I want to use Qt, is my only choice to make a special compilation of its libraries with MinGW-64?

    To build apps for Windows, you have 2 options:

    1. Download Microsoft Visual Studio 64-bit, and download the pre-built Qt packages.
    2. Download MinGW-w64 64-bit, and build Qt yourself.

    Note: Both options only let you build apps for Windows. To cross-compile for Linux, you still need to install another compiler and build/download another copy of Qt. (However, I find that it's not worthwhile to set up a cross-compiler on Windows; I find it easier to create a Linux virtual machine and transfer my source code there to build for Linux)



  • @JKSH

    Thanks! That is the info I needed and it gives me a lot to think about in deciding whether to move forward in Qt.

    Best regards,
    Gypsy


  • Moderators

    Hi @GypsyPrince,

    From http://forum.qt.io/topic/63760/vb6-clone-or-facsimile-based-on-qt and this thread, I get the impression that you're looking for a cross-platform toolkit that lets you produce 32-bit/64-bit native applications for multiple platforms, using just one compiler. Unfortunately, this combo is not possible in the real world (yet?).

    Native code is fundamentally different across different platforms, which is why you need a different compiler for each platform.

    The whole reason Java is able to let developers "compile once, execute everywhere" is because of the Java virtual machine: It takes one executable, and translates it into the platform's native code at runtime. If you want to avoid virtual machines or interpreters, then you need to find a toolkit that lets you "write once, compile everywhere" instead. Qt is one such toolkit (and it's an awesome one, too ;) )



  • @ JKSH...

    That's not quite accurate. In fact, I currently use MinGW-64 along with Code::Blocks to develop cross-platform apps which work on both my Windows 10 and Ubuntu systems. I have to change some compiler parameter settings in the Code::Blocks IDE, make a few changes to the make file, then recompile for each different OS. But I use the same compiler and don't have to make any changes to my code.

    https://sourceforge.net/p/mingw-w64/wiki2/CrossQuickstart/

    I'm quite happy with Code::Blocks and MinGW-64. I was just curious to learn more about the Qt libraries and to see if I might like them better than the xWidgets libraries for GUI development.

    While MinGW-64 was a beast to configure for use with Code::Blocks as well, I have a friend set it up for me the first time and she made screen shots of the entire process. Pictures are worth a thousand words, so any time I have to re-install Code::Blocks I just follow the pictures and in about 2 minutes all works perfectly.

    But I suppose my question was answered earlier. I've pretty much come to the conclusion that Qt will do what I need, at least not without time-consuming rebuilds or workarounds, and that I should stick with the familiarity of Code::Blocks, Xojo, and Lazarus for cross-platform development, and Visual Studio (C++ and VB.NET) for WIndows only development.


Log in to reply
 

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