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. How to compile for Linux 32-bit on a Linux 64-bit platform?
Forum Update on Monday, May 27th 2025

How to compile for Linux 32-bit on a Linux 64-bit platform?

Scheduled Pinned Locked Moved Solved Installation and Deployment
5 Posts 2 Posters 2.6k Views
  • 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.
  • P Offline
    P Offline
    pims
    wrote on 19 May 2017, 11:26 last edited by
    #1

    Dear all,

    I am having hard times trying to figure out how to configure the build system to get a 32-bit executable while developing on a 64-bit Linux station.

    I have done the following:

    • install all 32-bit libraries
    • add "-spec linux-g++-32" to qmake additional arguments
    • choose the 32-bit C and C++ compilers

    However in the Makefile generated by qmake I still see a lot of "/usr/lib64" paths used for the libraries instead of the expected "/usr/lib". I can see the "-m32" option used for g++ though.

    Anyone knows what is missing to get the correct result?

    Thanks!

    J 1 Reply Last reply 19 May 2017, 12:09
    0
    • P pims
      19 May 2017, 11:26

      Dear all,

      I am having hard times trying to figure out how to configure the build system to get a 32-bit executable while developing on a 64-bit Linux station.

      I have done the following:

      • install all 32-bit libraries
      • add "-spec linux-g++-32" to qmake additional arguments
      • choose the 32-bit C and C++ compilers

      However in the Makefile generated by qmake I still see a lot of "/usr/lib64" paths used for the libraries instead of the expected "/usr/lib". I can see the "-m32" option used for g++ though.

      Anyone knows what is missing to get the correct result?

      Thanks!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 19 May 2017, 12:09 last edited by
      #2

      @pims Did you install 32bit Qt?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • P Offline
        P Offline
        pims
        wrote on 19 May 2017, 12:22 last edited by
        #3

        Yes I installed all 32 and 64 bits packages.

        I am actually trying to understand what are the options in the project file or in qmake that make the correct library path to be used.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          pims
          wrote on 19 May 2017, 12:29 last edited by
          #4

          Here is what I can see in the Makefile:

          [...]

          Command: /usr/bin/qmake-qt5 -spec linux-g++-32 -o Makefile ../src/myproj.pro

          [...]
          LIBS = $(SUBLIBS) -L/usr/lib/qt5/plugins/sqldrivers -lqsqlmysql -L/usr/lib/mysql -lmysqlclient -L/usr/lib64 -lQt5Charts -lQt5Widgets -lQt5Gui -lQt5Sql -lQt5Xml -lQt5Core -lGL -lpthread

          I am expecting to see -L/usr/lib instead of -L/usr/lib64

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pims
            wrote on 19 May 2017, 15:43 last edited by
            #5

            OK, I found the culprit: I was using the correct compiler but the wrong Qt version in the kits definition.

            Thanks.

            1 Reply Last reply
            0

            1/5

            19 May 2017, 11:26

            • Login

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