Results 1 to 8 of 8

Thread: How to cross-build for a different Linux version (w/ Qt Creator)?

  1. #1
    Join Date
    Feb 2015
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question How to cross-build for a different Linux version (w/ Qt Creator)?

    Hello everyone,
    I recently upgraded my development system from Linux Mint 12 (which essentially is an Ubuntu 11.10) to the current LTS release of Ubuntu (14.04). This also upgraded Qt from 4.7.4 to 4.8.5. Now, my projects don't use any new features and thus compile fine on either system. But if I want an executable that runs on the older system, I have to compile it on the older system - not because of Qt itself, but because a binary compiled on the Ubuntu 14.04 requires a newer version of the glibc than what is availabe for the old system.

    I have a number of these old systems for which I want to compile the software, but as I need tools from the new devel system during development (not for compilation itself, but for testing certain things), I constantly have to reboot from the old to the new to the old system, so that I can develop on the new one, and then after first tests move the source to the old one, compile and run it there.

    This is very inconvenient. So my question in short is: is there a way to create a toolchain or add-on to the development environment on the new system, so that I can cross-compile there for the old Ubuntu 11.10. I have a second machine where I can run the binary with the old system (that's the actual target machine for the program), but that machine has no development tools whatsoever, plus it is way too slow to compile on there (slow Intel Atom CPU, small memory).

    So, it there a way to cross-compile Qt projects on Ubuntu 14.04 for Ubuntu 11.10? Any help is appreciated.

    Best regards, Michael
    Last edited by Hes; 25th February 2015 at 19:17.

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

    Default Re: How to cross-build for a different Linux version (w/ Qt Creator)?

    Quote Originally Posted by Hes View Post
    This is very inconvenient. So my question in short is: is there a way to create a toolchain or add-on to the development environment on the new system, so that I can cross-compile there for the old Ubuntu 11.10. I have a second machine where I can run the binary with the old system (that's the actual target machine for the program), but that machine has no development tools whatsoever, plus it is way too slow to compile on there (slow Intel Atom CPU, small memory).
    The easiest approach I can think of is to have a chroot of the older system in the newer system and build within that chroot. Have a look at 'schroot'.
    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. The following user says thank you to wysota for this useful post:

    Hes (27th February 2015)

  4. #3
    Join Date
    Feb 2015
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to cross-build for a different Linux version (w/ Qt Creator)?

    I installed oneiric via debootstrap and schroot, and then installed qtcreator and all the development stuff. Nevertheless, the qtcreator in the schroot says he can't find a toolchain, neither automatic nor when I explicitly (manually) point it towards /usr/bin/qmake-qt4. Thus, when I load a project, he complains "No valid qt versions found".

    What am I doing wrong this time?

    Cheers, Michael.

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

    Default Re: How to cross-build for a different Linux version (w/ Qt Creator)?

    Did you install Qt inside that chroot?
    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.


  6. #5
    Join Date
    Feb 2015
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to cross-build for a different Linux version (w/ Qt Creator)?

    Yes, of course. I did an "apt-get install qtcreator" which installed this all:

    Qt Code:
    1. ii libqt4-dbus 4:4.7.4-0ubuntu8.3 Qt 4 D-Bus module
    2. ii libqt4-declarative 4:4.7.4-0ubuntu8.3 Qt 4 Declarative module
    3. ii libqt4-declarative-gestures 4:4.7.4-0ubuntu8.3 Qt 4 gestures QML plugin
    4. ii libqt4-declarative-particles 4:4.7.4-0ubuntu8.3 Qt 4 particles QML plugin
    5. ii libqt4-declarative-shaders 4:4.7.4-0ubuntu8.3 Qt 4 shaders QML plugin
    6. ii libqt4-designer 4:4.7.4-0ubuntu8.3 Qt 4 designer module
    7. ii libqt4-dev 4:4.7.4-0ubuntu8.3 Qt 4 development files
    8. ii libqt4-help 4:4.7.4-0ubuntu8.3 Qt 4 help module
    9. ii libqt4-network 4:4.7.4-0ubuntu8.3 Qt 4 network module
    10. ii libqt4-opengl 4:4.7.4-0ubuntu8.3 Qt 4 OpenGL module
    11. ii libqt4-opengl-dev 4:4.7.4-0ubuntu8.3 Qt 4 OpenGL library development files
    12. ii libqt4-qt3support 4:4.7.4-0ubuntu8.3 Qt 3 compatibility library for Qt 4
    13. ii libqt4-script 4:4.7.4-0ubuntu8.3 Qt 4 script module
    14. ii libqt4-scripttools 4:4.7.4-0ubuntu8.3 Qt 4 script tools module
    15. ii libqt4-sql 4:4.7.4-0ubuntu8.3 Qt 4 SQL module
    16. ii libqt4-sql-mysql 4:4.7.4-0ubuntu8.3 Qt 4 MySQL database driver
    17. ii libqt4-sql-sqlite 4:4.7.4-0ubuntu8.3 Qt 4 SQLite 3 database driver
    18. ii libqt4-svg 4:4.7.4-0ubuntu8.3 Qt 4 SVG module
    19. ii libqt4-test 4:4.7.4-0ubuntu8.3 Qt 4 test module
    20. ii libqt4-xml 4:4.7.4-0ubuntu8.3 Qt 4 XML module
    21. ii libqt4-xmlpatterns 4:4.7.4-0ubuntu8.3 Qt 4 XML patterns module
    22. ii libqtcore4 4:4.7.4-0ubuntu8.3 Qt 4 core module
    23. ii libqtgui4 4:4.7.4-0ubuntu8.3 Qt 4 GUI module
    24. ii libqtwebkit-dev 2.2~2011week36-0ubuntu1 Web content engine library for Qt - development files
    25. ii libqtwebkit4 2.2~2011week36-0ubuntu1 Web content engine library for Qt
    26. ii qt4-demos 4:4.7.4-0ubuntu8.3 Qt 4 examples and demos
    27. ii qt4-designer 4:4.7.4-0ubuntu8.3 graphical designer for Qt 4 applications
    28. ii qt4-dev-tools 4:4.7.4-0ubuntu8.3 Qt 4 development tools
    29. ii qt4-doc 4:4.7.4-0ubuntu8.3 Qt 4 API documentation
    30. ii qt4-linguist-tools 4:4.7.4-0ubuntu8.3 Qt 4 Linguist tools
    31. ii qt4-qmake 4:4.7.4-0ubuntu8.3 Qt 4 qmake Makefile generator tool
    32. ii qt4-qmlviewer 4:4.7.4-0ubuntu8.3 Qt 4 QML viewer
    33. ii qtcreator 2.2.1-1ubuntu4 lightweight integrated development environment (IDE) for Qt
    34. ii qtcreator-doc 2.2.1-1ubuntu4 documentation for Qt Creator IDE
    To copy to clipboard, switch view to plain text mode 

    Is anything missing?

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

    Default Re: How to cross-build for a different Linux version (w/ Qt Creator)?

    So is the problem with your project or with lack of valid Qt installation? Can you build the project from the command line?
    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.


  8. #7
    Join Date
    Feb 2015
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to cross-build for a different Linux version (w/ Qt Creator)?

    I have never built a Qt project from the command line before, so I really can't say whether that works (or how to do it). I you tell me what to test, I will happily try.

    So far, I tried to load the project which worked both in the new qtcreator and in the one from the old installation. It fails to load in this new schroot enviroment, though, with the error listed above.

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

    Default Re: How to cross-build for a different Linux version (w/ Qt Creator)?

    Quote Originally Posted by Hes View Post
    I have never built a Qt project from the command line before, so I really can't say whether that works (or how to do it). I you tell me what to test, I will happily try.
    Open a chrooted commandline, cd to the project directory, call qmake and make.
    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.


Similar Threads

  1. Replies: 1
    Last Post: 13th December 2014, 17:08
  2. QT build - cross compilation error
    By qtch in forum Qt for Embedded and Mobile
    Replies: 22
    Last Post: 30th October 2012, 08:29
  3. Replies: 0
    Last Post: 10th July 2012, 21:16
  4. Replies: 2
    Last Post: 3rd October 2011, 23:04
  5. QtCreator and cross-compiling
    By zuck in forum Qt Tools
    Replies: 1
    Last Post: 28th April 2009, 20:04

Tags for this Thread

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.