How to use qt4.8.4 in QtCreator 2.7 with alredy installed Qt5.0.2



  • I have been using qt5 without any problem. Now i need use the qt4 for a project and i can't compile. I followed the tutorial to add a new QT version to QTcreator and seems no errors, However, when compile a hello world with qt4.8 i find some errrors related with Mingw.

    I haven't installed a new version of Mingw, i've only linked the compiler of qt5. The Debugger is also the same of qt5.

    I'm under Windows XP, but the problem seems the Mingw.

    This is the configuration:
    http://www.subirimagenes.com/imagen-dibujo-8500726.html(Conf Kits)

    This is the errors:
    http://www.subirimagenes.com/imagen-errores-8500731.html(Errors)


  • Moderators

    What version of MinGW was used to compile Qt4? If it was older than 4.7, it is not compatible with the one that is shipped with Qt5.



  • The version is the 4.7, but i don't have any problem with Qt5, the problem is with qt4 U;U
    To compile qt4 i used the same version of Mingw


  • Moderators

    Hm OK, it should be working then.


  • Moderators

    Where did you get Qt 4.8 from? Your approach will work only if you compiled the Qt 4 library yourself.

    If you downloaded the precompiled packages from http://qt-project.org/downloads , then you need to use MinGW 4.4 (the link says "Qt libraries 4.8.4 for Windows (minGW 4.4, 317 MB)") People have reported that MinGW 4.5 and 4.6 work too, but MinGW 4.7 is NOT compatible with MinGW 4.4



  • @JKSH: Yes, i downloaded the precompiled packages from that page.
    So for the Qt 5 I need the MinGW >= 4.7, but for use Qt 4.8.4 is necessary MinGW 4.4, 4.5 or 4.6, but not 4.7. Senseless. Seems, that i'll need install a old version of MinGW.

    But, have 2 versions of MinGW not cause incompatibilities? I'll need to put the binaries of MinGW 4.4 to PATH, but there I have the binaries of Mingw 4.7... Well, i put and i'll comment the result.

    @JKSH, @sierdzio: really thank you very much for the help =)


  • Moderators

    You're welcome :)

    [quote author="Hector" date="1371796297"]So for the Qt 5 I need the MinGW >= 4.7, but for use Qt 4.8.4 is necessary MinGW 4.4, 4.5 or 4.6, but not 4.7.[/quote]Correct. But, if you download the Qt 4.8 source code and build the DLLs using MinGW 4.7, then you can use the same compiler for both Qt versions.

    [quote]Senseless.[/quote] I disagree. Qt 4 is a very mature technology that is used by thousands of developers. The Qt Project must maintain compatibility with users' old projects, so it must continue to support MinGW 4.4. I know it's annoying though.

    [quote]But, have 2 versions of MinGW not cause incompatibilities? I'll need to put the binaries of MinGW 4.4 to PATH, but there I have the binaries of Mingw 4.7...[/quote]You're right: It will cause conflicts. It is best to not have 2 versions of MinGW in your PATH.

    Just configure Qt Creator's compilers and kits, and you can build projects without having MinGW in your PATH



  • @JKSH: Mmm maybe the best option is build dll using MinGW 4.7. I think that is a good idea maintain the compatibility with users old projects, but was a good idea put the same compilator of Mingw to QT4 and QT5 u.u

    Wll, I have download the source of 4.8. If I want build and compile the Qt 4.8 i must open the Command Prompt of Mingw 4.7 and write qmake -project, after qmake and finishing with a makefile?

    Thanks again JKSH!! You're my savior :P


  • Moderators

    Hi Hector,

    You don't need to write your own qmake-project. Just follow the instructions at http://qt-project.org/doc/qt-4.8/install-win.html . It was written for Visual Studio so you need to change it a bit:

    Call "configure", not "configure -platform win32-msvc"

    Call mingw32-make, not nmake

    Good luck!


Log in to reply
 

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