Results 1 to 5 of 5

Thread: Problem Running 32bit QT Application on 64bit Machine Compiled in a Chroot (Ubuntu)

  1. #1
    Join Date
    Sep 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Problem Running 32bit QT Application on 64bit Machine Compiled in a Chroot (Ubuntu)

    Hi,

    I am attempting to run a 32bit application on a 64 bit machine running Ubuntu 10.4. I had to use a chroot running 32bit Ubuntu 9.10 to compile the application since it was written for 32bit. The issue at hand appears when attempting to connect the application to the postgres 8.4 database. The chroot is configured identically as the root, with the same applications installed. I have also installed 32 bit libraries on the 64bit machine.

    I can launch the application inside of the chroot environment and the database connects fine. However, When exiting the chroot it fails to connect and reports the error,

    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers:

    I can manually access the database using either environment simply by typing psql dbname.

    Also, is there a location where I can find more information on why this is failing, such as a QT log directory?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem Running 32bit QT Application on 64bit Machine Compiled in a Chroot (Ubunt

    What do you mean "when exiting the chroot"? You mean you want to launch the same application outside chroot? I would assume the application picks an incorrect library. You can check it out with ldd (check both the application and the QPSQL driver).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem Running 32bit QT Application on 64bit Machine Compiled in a Chroot (Ubunt

    Yep, I am looking to only compile inside of the chroot and then be able to use it outside.

    Also, it would appear to be returning the incorrect library,

    Inside the chroot (works),
    libQtCore.so.4 => /usr/share/qt4/lib/libQtCore.so.4 (0xf742c000)
    libQtSql.so.4 => /usr/share/qt4/lib/libQtSql.so.4 (0xf73ef000)
    libQtGui.so.4 => /usr/share/qt4/lib/libQtGui.so.4 (0xf6a51000)
    libQtNetwork.so.4 => /usr/share/qt4/lib/libQtNetwork.so.4 (0xf693b000)
    libQtXml.so.4 => /usr/share/qt4/lib/libQtXml.so.4 (0xf68f8000)
    Outside the chroot (does not work)
    libQtCore.so.4 => /chroot/usr/lib/libQtCore.so.4 (0xf7441000)
    libQtSql.so.4 => /chroot/usr/lib/libQtSql.so.4 (0xf7404000)
    libQtGui.so.4 => /chroot/usr/lib/libQtGui.so.4 (0xf6a66000)
    libQtNetwork.so.4 => /chroot/usr/lib/libQtNetwork.so.4 (0xf6950000)
    libQtXml.so.4 => /chroot/usr/lib/libQtXml.so.4 (0xf690c000)
    What I believe I need is to have the application outside of the chroot link to the libraries found in /chroot/usr/share/qt4/lib rather than /chroot/usr/lib/

    I will change the Environment Variables governing this and see if that fixes the issue.

    Thanks!
    Last edited by thaynes; 7th September 2011 at 20:56.

  4. #4
    Join Date
    Sep 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem Running 32bit QT Application on 64bit Machine Compiled in a Chroot (Ubunt

    I'm a bit unclear on how shared library dependencies work and having trouble linking the application to the correct libraries. Is there a way to manually link them? Also, how are the libraries chosen? Some linked are not from directories listed in LD_LIBRARY_PATH. Adding some directories to this environment variable change the links while others do not.

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem Running 32bit QT Application on 64bit Machine Compiled in a Chroot (Ubunt

    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers:
    When you are in your 64-bit environment the 32-bit application cannot find a 32-bit Qt SQL plugin for Postgres to load (or any others, e.g. Sqlite, by the look of it). This plugin will also need 32-bit Postgres libraries to be available. The default search path built in to the chrooted 32-bit Qt libraries (/usr/share/qt4/lib/plugins) will probably be still exist in the 64-bit environment but contain 64-bit plugins.

Similar Threads

  1. QVBoxLayout problem in Ubuntu 10.04 LTS 32bit
    By MarkoSan in forum Qt Programming
    Replies: 0
    Last Post: 16th March 2011, 06:55
  2. Build 64bit Qt on 32bit XP
    By photo_tom in forum Installation and Deployment
    Replies: 2
    Last Post: 2nd March 2011, 09:28
  3. Deploying 64bit on 32bit OS
    By M. in forum Newbie
    Replies: 7
    Last Post: 23rd April 2010, 22:15
  4. Qt 4.6 pr1 on Snow leopard? 64bit vs 32bit question
    By akos.maroy in forum Qt Programming
    Replies: 3
    Last Post: 3rd October 2009, 02:35
  5. Compiling Qt 32bit on 64bit os..
    By tgreaves in forum Newbie
    Replies: 2
    Last Post: 12th March 2009, 13:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.