Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved] Installing Qt 4.8.2 from sources using MinGW 4.7.x
Forum Updated to NodeBB v4.3 + New Features

[Solved] Installing Qt 4.8.2 from sources using MinGW 4.7.x

Scheduled Pinned Locked Moved Installation and Deployment
18 Posts 6 Posters 13.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Uwe Kindler
    wrote on last edited by
    #4

    Hi,

    I recently built Qt 4.8.1 with MinGW GCC 4.6.2 and also had some trouble when I used the platform win32-g++. Try to use the new platform win32-g++-4.6 for GCC compilers > 4.6. Here are my configuration options from configure.cache file:

    @-confirm-license
    -platform
    win32-g++-4.6
    -no-qt3support
    -qt-style-windows
    -qt-style-windowsxp
    -phonon
    -qt-style-windowsvista
    -plugin-sql-sqlite
    -plugin-sql-odbc
    -qt-zlib
    -qt-libpng
    -qt-libjpeg
    -qt-libtiff
    -qt-libmng
    -no-openssl
    -opensource
    -no-dsp
    -no-vcproj
    -no-incredibuild-xge
    -D
    _WIN32_WINNT=0x501 @

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      Zebbik
      wrote on last edited by
      #5

      @Lucas
      I have downloaded the version of MinGW from their website and then sourceforge. I did not realize there would be more versions of MinGW. I will try to read about them, though. As to limiting the build to debug, release, or keep develop-build, what would be the difference if I decided to have debug or release version, or even both?

      @Uwe
      Hi, I tried to compile Qt with g++ -v 4.7.0. I did not try to do it again, though as I am going to give it a go with VC2010.

      I would have a general question. I want to try the msvc 2010 compiler but I am not sure if it's better than MinGW. I personally always prefer MinGW over MS VC because MinGW seems to be closer to standard of GNU C++. MS has always been tented to implement their own tricky "solutions" when it comes to details. I hope VC2010 is different now but the question still remains whether VC2010 is better. Also, I am not sure that if I build Qt via MSVC 2010, will my application sources still be platform independent.

      1 Reply Last reply
      0
      • U Offline
        U Offline
        Uwe Kindler
        wrote on last edited by
        #6

        Compiling Qt 4.8.2 with MinGW GCC4.7.0 should work properly with the configuration options I posted above. The problem is the platform you selected (win32-g++). You need to select win32-g++-4.6 in order to compile with GCC versions >= GCC 4.6. So you should try it again with the given configuration options.

        If you have the money to buy a VS2010 license there is nothing wrong with VS2010 and Qt. Especially if you want to develop GPU accelerated applications with Nvidia CUDA library VS2010 is the right choice because CUDA does not support MinGW compiler. If you develop cross platform, e.g. for Windows and Linux, then MinGW might be the right choice because you use the same toolchain for both systems (GCC).

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #7

          [quote author="Zebbik" date="1345727364"]I have downloaded the version of MinGW from their website and then sourceforge. I did not realize there would be more versions of MinGW. I will try to read about them, though.[/quote]These are not exactly different versions, but rather the same version beeing built using a different toolchain, different compiler options and different dependencies. So if you run into a bug which is caused by a specific combination of the above chances are high that another build works.

          [quote author="Zebbik" date="1345727364"]As to limiting the build to debug, release, or keep develop-build, what would be the difference if I decided to have debug or release version, or even both?[/quote]A release build usually contains only code, optimizied for speed and size, a debug build additionally includes debug information which allows for (comfortable) debugging and bug tracking at the cost of decreased speed and increased size and a developer build is in principle an extended debug build, which basically allows for (automated) testing of Qt itself.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgeyer
            wrote on last edited by
            #8

            [quote author="Uwe Kindler" date="1345730525"]If you have the money to buy a VS2010 license there is nothing wrong with VS2010[/quote]The MSVC compiler comes for free as part of the Windows SDK and the Express Editions, what you pay for is Visual Studio.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              Zebbik
              wrote on last edited by
              #9

              Thanks Uwe,
              I'm sorry I miss the platform configuration you have specified "-platform win32-g++-4.6". I don't know why. I did not find it in the documentation as well.
              The main reason I am compiling Qt is that I need a functional plugin mysql and openssl. I have database put on server and I an application that can operate on this database. OpenSsl is not that important as mysql. I am not interested in CUDA and GPU accelerated applications at all. From what you have said, everything is on MinGW side :) Thanks for this post. I am really happy I can stick to MinGW. I will go and try GNU GCC with proper option specified. Hopefully, this time it will get through.

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                Zebbik
                wrote on last edited by
                #10

                [quote author="Lukas Geyer" date="1345731383"]These are not exactly different versions, but rather the same version beeing built using a different toolchain, different compiler options and different dependencies. So if you run into a bug which is caused by a specific combination of the above chances are high that another build works.[/quote]I see. Now I know what I am dealing with. On the same website, there is a version of MinGW 4.4 availabel to download as well as the Qt sources. It seems to be that this version of MinGW might be "tuned" so that Qt can be built properly. I am not sure if it's the case, though.

                [quote author="Lukas Geyer" date="1345731383"]A release build usually contains only code, optimizied for speed and size, a debug build additionally includes debug information which allows for (comfortable) debugging and bug tracking at the cost of decreased speed and increased size and a developer build is in principle an extended debug build, which basically allows for (automated) testing of Qt itself.[/quote]I understand that if I am not going to test Qt itself, then I probably don't need -debug version. I do not even feel I would be of any help to find a bug, not on this stage i am afraid. Perhaps later :)

                Thank you

                1 Reply Last reply
                0
                • U Offline
                  U Offline
                  Uwe Kindler
                  wrote on last edited by
                  #11

                  [quote author="Lukas Geyer" date="1345731538"]The MSVC compiler comes for free as part of the Windows SDK and the Express Editions, what you pay for is Visual Studio.
                  [/quote]

                  Visual Studio Express 11 does not support desktop applications but only metro applications:

                  "http://www.golem.de/news/visual-studio-11-kostenlose-express-version-unterstuetzt-nur-metro-apps-1205-91989.html":http://www.golem.de/news/visual-studio-11-kostenlose-express-version-unterstuetzt-nur-metro-apps-1205-91989.html

                  You still can use Visual Studio Express 10 but then you will not get the new C++ features that will be implemented for new compilers.

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    lgeyer
                    wrote on last edited by
                    #12

                    "No":http://blogs.msdn.com/b/visualstudio/archive/2012/06/08/visual-studio-express-2012-for-windows-desktop.aspx, Visual Studio Express 2012 has support for C++ for Desktop and Console applications.

                    If you do not need Visual Studio the compiler suite is included in the Windows SDK 8 as well.

                    And, well, there are no new C++ features in MSVC2012 except for some minor stuff like range-based for, strongly-typed enums and a bit of concurreny (mostly stuff that is already provided by Qt). Still no const expressions, no delegation, no constructor inheritance, no initializer lists, no non-static data-member initialization, no unicode literals, not even variadic templates.

                    (Serious) C++11 means Intel, GCC or Clang. Forget about MSVC.

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      lgeyer
                      wrote on last edited by
                      #13

                      [quote author="Zebbik" date="1345732703"]On the same website, there is a version of MinGW 4.4 availabel to download as well as the Qt sources. It seems to be that this version of MinGW might be "tuned" so that Qt can be built properly. I am not sure if it's the case, though.[/quote]You don't need to bother with MinGW 4.4. It is outdated, broken and no longer supported as of Qt5. Go for MinGW 4.6.3+ or MinGW 4.7+ instead. I'm using the mingw-builds and I haven't had a problem so far with Qt 4.8+ and Qt 5.

                      [quote author="Lukas Geyer" date="1345731383"]I understand that if I am not going to test Qt itself, then I probably don't need -debug version.[/quote]You will need a debug version of the libraries if you want to step into Qt itself when debugging your application (otherwise you'll be just dumped into a bunch of disassembly).

                      So I strongly recommend building a debug version of Qt as well when you plan to build a debug version of your application. You should be theoretically able to link your debug application to a release Qt but experience has shown that this is really just theoretical.

                      1 Reply Last reply
                      0
                      • Z Offline
                        Z Offline
                        Zebbik
                        wrote on last edited by
                        #14

                        I am glad you told me about debug. I was not aware of requiring it when it comes to debug my own applications and I'd probably build Qt without it.
                        MinGW 4.4 is installed with QtSDK and I though I could change Path to this folder but if you say it's not a good idea then I'll try different toolchains as mentioned or change configuration with remaining MinGW 4.7.0 I have installed. Hope this time it 's going to work.

                        Thanks
                        Best wishes.

                        1 Reply Last reply
                        0
                        • Z Offline
                          Z Offline
                          Zebbik
                          wrote on last edited by
                          #15

                          I am happy to say that after the whole night my comp finally built Qt 4.8.2 ^^ using MinGW 4.7.0. My previous projects from QtSDK work, QLocale, QTranslator work, QMYSQL work woohoo .... I am so happy. So far, so good.

                          I genuinely say thank you for the help :)

                          1 Reply Last reply
                          0
                          • L Offline
                            L Offline
                            lgeyer
                            wrote on last edited by
                            #16

                            You're welcome.

                            One last hint: if you don't need Webkit skip building it (using <code>--no-webkit</code>). This greatly reduces compilation time.

                            1 Reply Last reply
                            0
                            • C Offline
                              C Offline
                              cspringer
                              wrote on last edited by
                              #17

                              In my opinion, this is a classic example of a failure to test and create the "correct" solution to the problem. The OP's problem is caused by code bloat from inlined functions. The easiest way to fix this problem is to pass -fno-keep-inline-dllexport as a compiler option. Ideally, the win32-g++ mkspec should be updated with this change. I worked on creating a patch for this problem this weekend but after patching and building Qt I got distracted by the multitude of problems I had building qt-creator. Beware if you move on to build creator, there are several bugs when building with win32 vs. win64. For example, on win32 builds, MIB_TCP_STATE will be undefined because of an incorrect preprocessor check for the version of GCC.

                              Hopefully this will serve as a wake-up call for people to do more testing before pushing code and releasing immature versions.

                              Chris

                              [quote author="Zebbik" date="1345647851"]Hi

                              I configured makefile using this command:
                              @.\configure.exe -opensource -plugin-sql-mysql -plugin-sql-sqlite -plugin-sql-odbc -developer-build -no-qt3support -platform win32-g++ -I C:\ApacheMysqlPhp\Mysql\include -L C:\ApacheMysqlPhp\Mysql\lib -L C:\ApacheMysqlPhp\Mysql\lib\opt
                              @

                              and then executed make.exe (make.exe is the same file as mingw32-c++.exe, mingw32-gcc.exe, mingw32-g++.exe etc.). However in the middle, the process stopped with this log:
                              @c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: final link failed: Memory exhausted
                              collect2.exe: error: ld returned 1 exit status
                              make[2]: *** [....\lib\QtGuid4.dll] Error 1
                              make[2]: Leaving directory C:/Qt/4.8.2/src/gui' make[1]: *** [debug-all] Error 2 make[1]: Leaving directory C:/Qt/4.8.2/src/gui'
                              make: *** [sub-gui-make_default-ordered] Error 2@

                              I have windows 7 64bit. Why is there this error?
                              [/quote]

                              1 Reply Last reply
                              0
                              • T Offline
                                T Offline
                                Tinrik
                                wrote on last edited by
                                #18

                                [quote author="Zebbik" date="1345795721"]I am happy to say that after the whole night my comp finally built Qt 4.8.2 ^^ using MinGW 4.7.0. My previous projects from QtSDK work, QLocale, QTranslator work, QMYSQL work woohoo .... I am so happy. So far, so good.

                                I genuinely say thank you for the help :)
                                [/quote]

                                Hi Zebbik,

                                I'm also trying to update the MigGW compiler to the 4.7 version and keep working with QtSDK. I'm a beginner and I don't know much about how to compile Qt and configure QtCreator properly to work with it (not with the default MinGW 4.4)... Could you tell me more or less the steps you took to get it working?

                                Thank you very much!!

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved