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. Building qt 5.5.1 with TDM GCC for 32 bit Windows
Forum Updated to NodeBB v4.3 + New Features

Building qt 5.5.1 with TDM GCC for 32 bit Windows

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
7 Posts 2 Posters 3.2k Views 2 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.
  • _ Offline
    _ Offline
    _matt.
    wrote on 21 Jan 2016, 18:04 last edited by _matt.
    #1

    I have TDM GCC 64 which does support building 32 bit targets with -m32 flag.
    However, no matter what flags I pass to qt's configure it always sets the architecture to 64 bits.
    Is there a way to compile qt from sources with TDM GCC for 32 bit Windows?

    Here are the typical flags:

    configure -static -prefix C:\qt_static -release -platform win32-g++ -nomake tests -nomake examples -opengl desktop -opensource -confirm-license
    

    Here is the output:

    QMAKESPEC...................win32-g++ (commandline)
    Architecture................x86_64, features: mmx sse sse2
    Host Architecture...........x86_64, features: mmx sse sse2
    Maketool....................mingw32-make
    Debug.......................no
    Force debug info............no
    C++11 support...............yes
    Link Time Code Generation...no
    Accessibility support.......yes
    RTTI support................yes
    SSE2 support................yes
    SSE3 support................yes
    SSSE3 support...............yes
    SSE4.1 support..............yes
    SSE4.2 support..............yes
    AVX support.................yes
    AVX2 support................yes
    NEON support................no
    OpenGL support..............yes
    Large File support..........yes
    NIS support.................no
    Iconv support...............no
    Evdev support...............no
    Mtdev support...............no
    Inotify support.............no
    eventfd(7) support..........no
    Glib support................no
    CUPS support................no
    OpenVG support..............no
    SSL support.................no
    OpenSSL support.............no
    libproxy support............no
    Qt D-Bus support............no
    Qt Widgets module support...yes
    Qt GUI module support.......yes
    QML debugging...............yes
    DirectWrite support.........no
    Use system proxies..........no
    
    QPA Backends:
        GDI.....................yes
        Direct2D................no
    
    Third Party Libraries:
        ZLIB support............qt
        GIF support.............yes
        JPEG support............yes
        PNG support.............yes
        FreeType support........yes
        Fontconfig support......no
        HarfBuzz support........qt
        PCRE support............qt
        ICU support.............no
        ANGLE...................no
        Dynamic OpenGL..........no
    
    Styles:
        Windows.................yes
        Windows XP..............yes
        Windows Vista...........yes
        Fusion..................yes
        Windows CE..............no
        Windows Mobile..........no
    
    Sql Drivers:
        ODBC....................no
        MySQL...................no
        OCI.....................no
        PostgreSQL..............no
        TDS.....................no
        DB2.....................no
        SQLite..................yes (qt)
        SQLite2.................no
        InterBase...............no
    
    Sources are in..............C:\Users\GT70\Source\qt_source\qt-everywhere-opensource-src-5.5.1\qtbase
    Build is done in............C:\Users\GT70\Source\qt_source\qt-everywhere-opensource-src-5.5.1\qtbase
    Install prefix..............C:\qt_static
    Headers installed to........C:\qt_static\include
    Libraries installed to......C:\qt_static\lib
    Arch-dep. data to...........C:\qt_static
    Plugins installed to........C:\qt_static\plugins
    Library execs installed to..C:\qt_static\bin
    QML1 imports installed to...C:\qt_static\imports
    QML2 imports installed to...C:\qt_static\qml
    Binaries installed to.......C:\qt_static\bin
    Arch-indep. data to.........C:\qt_static
    Docs installed to...........C:\qt_static\doc
    Translations installed to...C:\qt_static\translations
    Examples installed to.......C:\qt_static\examples
    Tests installed to..........C:\qt_static\tests
    WARNING: Using static linking will disable the use of plugins.
             Make sure you compile ALL needed modules into the library.
    
    
    
    Qt is now configured for building. Just run mingw32-make.
    To reconfigure, run mingw32-make confclean and configure.
    
    
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 21 Jan 2016, 23:09 last edited by
      #2

      Hi and welcome to devnet,

      I'd copy the win32-g++ mkspec to e.g. win32-g++32 and add

      QMAKE_CFLAGS            = -m32
      QMAKE_LFLAGS            = -m32
      

      to qmake.conf

      Don't forget the license implication when using a static build.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • _ Offline
        _ Offline
        _matt.
        wrote on 22 Jan 2016, 17:51 last edited by
        #3

        Thank you for quick reply.
        I found a way to configure it to compile 32 bit architecture.
        Here is what I used:

        $ configure -prefix C:/qt_source -release -opengl desktop -xplatform win32-g++ -opensource -confirm-license -nomake tests -nomake examples -static -device-option CROSS_COMPILE=mingw32-
        

        Now I hit another problem, when it is invoking archiver, it is looking for mingw32-ar, while TDM GCC's archiver is called just ar.
        I tried just renaming it, but there were still issues building it. (The files are not compatible)
        Do you have any ideas what to add to that?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 22 Jan 2016, 21:56 last edited by
          #4

          Then you may have to also add some parameters to ar, you can modify that in the qmake.conf file under QMAKE_LIB

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • _ Offline
            _ Offline
            _matt.
            wrote on 22 Jan 2016, 23:35 last edited by _matt.
            #5

            I added "--target=pei-i386" to QMAKE_LIB it so that they are 32bits.
            However, I still get error:

            g++ -Wl,--gc-sections -Wl,-s -Wl,-subsystem,console -o ..\..\..\bin\moc.exe .obj/release/moc.o .obj/release/preprocessor.o .obj/release/generator.o .obj/release/parser.o .obj/release/token.o .obj/release/main.o  -LC:/Users/GT70/Source/qt_source/qt-everywhere-opensource-src-5.5.1/qtbase/lib -lQt5Bootstrap -luser32 -lole32 -ladvapi32 -lshell32
            C:/Users/GT70/Source/qt_source/qt-everywhere-opensource-src-5.5.1/qtbase/lib/libQt5Bootstrap.a: error adding symbols: Archive has no index; run ranlib to add one
            collect2.exe: error: ld returned 1 exit status
            Makefile.Release:100: recipe for target '..\..\..\bin\moc.exe' failed
            

            There is the same error if I do not include this flag either.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 23 Jan 2016, 23:48 last edited by
              #6

              Did you do a clean build after you modified the mkspec ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • _ Offline
                _ Offline
                _matt.
                wrote on 26 Jan 2016, 17:01 last edited by
                #7

                yes I did.
                I think I will switch to another tool and give it a go there, TDM GCC is not the best set up for cross compiling I guess.

                1 Reply Last reply
                0

                1/7

                21 Jan 2016, 18:04

                • Login

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