Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to create a 32-bit application on 64-bit machine
Forum Updated to NodeBB v4.3 + New Features

How to create a 32-bit application on 64-bit machine

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 11.6k 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.
  • A Offline
    A Offline
    adnan
    wrote on last edited by
    #1

    Ubuntu 11.10 (and onwards) supports 32-bit as well as 64-bit apps i.e. 32 & 64 bit libraries are present. I tried my my best by making changes in "makefile" replacing 64-bit lib paths with i386 paths but all in vain. I have both 32 as well as 64 bit qt libs installed but only 64 bit compilation occurs. 32 bit apps run nicely on my 64-bit computer, but i can't compile 32 bit apps.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      akrynski
      wrote on last edited by
      #2

      Dimitri by Google said:
      @I suggest you create your own mkspecs/linux-g++-32 directory, it's just
      a matter of adding "-m32" to QMAKE_CFLAGS, QMAKE_CXXFLAGS, QMAKE_LFLAGS.@

      and did u seen this: http://www.cyberciti.biz/tips/compile-32bit-application-using-gcc-64-bit-linux.html

      --
      Pozdrawiam i do następnego...
      Greetings and till next...

      1 Reply Last reply
      0
      • A Offline
        A Offline
        adnan
        wrote on last edited by
        #3

        @mkspecs/linux-g++-32 directory is already present@
        After making all the necessary changes: i get following error:
        @/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libQtGui.so when searching for -lQtGui
        /usr/bin/ld: cannot find -lQtGui
        /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libQtCore.so when searching for -lQtCore
        /usr/bin/ld: cannot find -lQtCore
        /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpthread.so when searching for -lpthread
        /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpthread.a when searching for -lpthread
        collect2: ld returned 1 exit status
        make: *** [netbridge] Error 1
        @

        The makefile automatically gets changed with every i386 replaced with x86-64

        1 Reply Last reply
        0
        • A Offline
          A Offline
          akrynski
          wrote on last edited by
          #4

          @/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libQtGui.so when searching for -lQtGui@

          I think this is the right issue, while if you set 32bit libraries as default these ARE incompatible.
          Question is if make finds the right ones, and if nor than why. Are all paths set properly?

          --
          Pozdrawiam i do następnego...
          Greetings and till next...

          1 Reply Last reply
          0
          • A Offline
            A Offline
            adnan
            wrote on last edited by
            #5

            The address for lib in makefile is:
            @ /usr/lib/i386-linux-gnu/@
            But it still looks in
            @/usr/lib/x86_64-linux-gnu@
            The above error occurs because of using -m32. The makefile automatically gets changed with every i386 replaced with x86-64 after typing make in terminal.
            So what to do.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              akrynski
              wrote on last edited by
              #6

              and variable $LIBRARY_PATH directs to where?

              --
              Pozdrawiam i do następnego...
              Greetings and till next...

              1 Reply Last reply
              0
              • A Offline
                A Offline
                adnan
                wrote on last edited by
                #7

                Actually nowhere @echo $LIBRARY_PATH@ outputs nothing.
                I am uploading the make files:
                http://sharescanner.net84.net/make.tar.gz

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  akrynski
                  wrote on last edited by
                  #8

                  I am sorry, I am not so much familiar with linux programming, so I can't help you any more.
                  After that I have no linux instalation on my computers since years, and so many has changed...

                  I think u should set LIBRARY_PATH and export it somehow to QT_LIBDIRS. The same with includes.
                  I also have experienced that some tools caches data,so to see changes it is sometimes usefull to delete data and build directories in (epoc32 in my case) QtSDK

                  --
                  Pozdrawiam i do następnego...
                  Greetings and till next...

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    tobias.hunger
                    wrote on last edited by
                    #9

                    How about setting up a 32bit system in a chroot using debootstrap and then building the 32binaries in there? That gets you round the trouble of making sure that the compiler does not accidentally pick up the wrong thing.

                    I basically have one chroot per project (and target environment) set up. That gets me around cross-compiling and has the nice side effect that I notice whenever somebody introduces a new dependency (which is not installed in my minimalistic chroots;-). schroot is a nice tool to manage the zoo of chroots and switch between those by the way.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      adnan
                      wrote on last edited by
                      #10

                      I have never used chroot before, but it seems it is worth giving a try. Thanks!

                      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