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. Compiling on Ubuntu 64bit for 32bit - App looks bad
Forum Updated to NodeBB v4.3 + New Features

Compiling on Ubuntu 64bit for 32bit - App looks bad

Scheduled Pinned Locked Moved Installation and Deployment
8 Posts 2 Posters 5.9k 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.
  • S Offline
    S Offline
    ShimaCZ
    wrote on last edited by
    #1

    Hi,
    I have written app and when I will compile it for 64bit version, it looks well. But if I will compile it for 32bit, no matter if with dynamic or static linking of Qt libs, it looks bad. I'm running Ubuntu 64-bit and using qmake. If I'm compiling for 32bit, I'm using 32bit version of qmake.

    My pro file:
    @
    QT += core gui

    CONFIG += 32bit

    CONFIG(32bit) {
    TARGET = 5inRow32
    QMAKE_CXXFLAGS += -m32
    LIBS += -L/opt/Qt-32b//lib -lQtGui -L/opt/Qt-32b/lib -lXext -lX11 -lQtCore -lm -ldl -lrt -lpthread
    }

    CONFIG(64bit) {
    TARGET = 5inRow64
    }

    QMAKE_LFLAGS += -Wl,-rpath='$$ORIGIN'

    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp
    board.cpp
    settings.cpp
    fiveinrowai.cpp

    HEADERS += mainwindow.h
    board.h
    settings.h
    fiveinrowai.h
    @

    Thanks in advise.

    1 Reply Last reply
    0
    • frankcyblogic.deF Offline
      frankcyblogic.deF Offline
      frankcyblogic.de
      wrote on last edited by
      #2

      Define 'bad'. I guess you mean it shows up in an ugly style. But how should a 32 bit lib retrieve its styling from a 64 bit lib? They can't link against each other.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        ShimaCZ
        wrote on last edited by
        #3

        Yes, its ugly style, like win98. It is game 5 in row and circles painted on board look also awful. Image will be more ilustrative: http://i56.tinypic.com/14kl2k8.png
        But even if I will run it on 32bit Ubuntu, it looks that ugly.

        1 Reply Last reply
        0
        • frankcyblogic.deF Offline
          frankcyblogic.deF Offline
          frankcyblogic.de
          wrote on last edited by
          #4

          Then run ldd to see which library you are linking on your 32bit deployment target. In your case QGtkStyle is delivering the correct styling and it does so by asking gtk's theme engine. Of course that can only work with dynamically linked dlls build for your target system. 32bit libs on your 64 bit system are most likely compiled without gtk style support.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            ShimaCZ
            wrote on last edited by
            #5

            ldd shows this:
            @
            shima@debian:/mnt/hgfs/Shared Folder/Unix X11 32bit$ ldd ./5inRow32
            linux-gate.so.1 => (0xb77aa000)
            libXext.so.6 => /usr/lib/libXext.so.6 (0xb778a000)
            libX11.so.6 => /usr/lib/libX11.so.6 (0xb766d000)
            libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7668000)
            librt.so.1 => /lib/i686/cmov/librt.so.1 (0xb765f000)
            libQtGui.so.4 => /mnt/hgfs/Shared Folder/Unix X11 32bit/./libQtGui.so.4 (0xb6b27000)
            libQtCore.so.4 => /mnt/hgfs/Shared Folder/Unix X11 32bit/./libQtCore.so.4 (0xb6873000)
            libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb685a000)
            libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6764000)
            libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb673e000)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6720000)
            libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb65da000)
            libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb65c1000)
            /lib/ld-linux.so.2 (0xb77ab000)
            libXau.so.6 => /usr/lib/libXau.so.6 (0xb65bd000)
            libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb65b8000)
            @

            So I have to install different package with GTK style support? Could you give me advise which package is it?

            1 Reply Last reply
            0
            • frankcyblogic.deF Offline
              frankcyblogic.deF Offline
              frankcyblogic.de
              wrote on last edited by
              #6

              No, just make it link against your target system's Qt library. Maybe it helps already if you put the default location into LD_LIBRARY_PATH?
              <code>$ LD_LIBRARY_PATH=/usr/lib ./5inRow32</code>

              1 Reply Last reply
              0
              • S Offline
                S Offline
                ShimaCZ
                wrote on last edited by
                #7

                Qt library is distributed with app and its linked correctly. I've used libs compiled on my deployment machine (Ubuntu 10.04 64-bit) with Qt lib conf:
                @./configure -prefix /opt/Qt-32b -platform linux-g++-32b -release -nomake demos -nomake examples
                make sub-src@
                and then build it this way:
                @PATH=/opt/Qt-32b/bin:$PATH
                export PATH
                qmake -config -release
                make && make clean@
                and put Qt libs to folder with app.

                .pro file is above.
                Maybe I've missed something.

                1 Reply Last reply
                0
                • frankcyblogic.deF Offline
                  frankcyblogic.deF Offline
                  frankcyblogic.de
                  wrote on last edited by
                  #8

                  I would think you can't have a correctly linked 32 bit library which works theming wise on your 64 bit system. And if you distribute that, it of course keeps looking the same on the 32 bit target host.

                  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