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
Re: How to cross-build for a different Linux version (w/ Qt Creator)?
Quote:
Originally Posted by
Hes
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'.
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.
Re: How to cross-build for a different Linux version (w/ Qt Creator)?
Did you install Qt inside that chroot?
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:
Code:
ii libqt4-dbus 4:4.7.4-0ubuntu8.3 Qt 4 D-Bus module
ii libqt4-declarative 4:4.7.4-0ubuntu8.3 Qt 4 Declarative module
ii libqt4-declarative-gestures 4:4.7.4-0ubuntu8.3 Qt 4 gestures QML plugin
ii libqt4-declarative-particles 4:4.7.4-0ubuntu8.3 Qt 4 particles QML plugin
ii libqt4-declarative-shaders 4:4.7.4-0ubuntu8.3 Qt 4 shaders QML plugin
ii libqt4-designer 4:4.7.4-0ubuntu8.3 Qt 4 designer module
ii libqt4-dev 4:4.7.4-0ubuntu8.3 Qt 4 development files
ii libqt4-help 4:4.7.4-0ubuntu8.3 Qt 4 help module
ii libqt4-network 4:4.7.4-0ubuntu8.3 Qt 4 network module
ii libqt4-opengl 4:4.7.4-0ubuntu8.3 Qt 4 OpenGL module
ii libqt4-opengl-dev 4:4.7.4-0ubuntu8.3 Qt 4 OpenGL library development files
ii libqt4-qt3support 4:4.7.4-0ubuntu8.3 Qt 3 compatibility library for Qt 4
ii libqt4-script 4:4.7.4-0ubuntu8.3 Qt 4 script module
ii libqt4-scripttools 4:4.7.4-0ubuntu8.3 Qt 4 script tools module
ii libqt4-sql 4:4.7.4-0ubuntu8.3 Qt 4 SQL module
ii libqt4-sql-mysql 4:4.7.4-0ubuntu8.3 Qt 4 MySQL database driver
ii libqt4-sql-sqlite 4:4.7.4-0ubuntu8.3 Qt 4 SQLite 3 database driver
ii libqt4-svg 4:4.7.4-0ubuntu8.3 Qt 4 SVG module
ii libqt4-test 4:4.7.4-0ubuntu8.3 Qt 4 test module
ii libqt4-xml 4:4.7.4-0ubuntu8.3 Qt 4 XML module
ii libqt4-xmlpatterns 4:4.7.4-0ubuntu8.3 Qt 4 XML patterns module
ii libqtcore4 4:4.7.4-0ubuntu8.3 Qt 4 core module
ii libqtgui4 4:4.7.4-0ubuntu8.3 Qt 4 GUI module
ii libqtwebkit-dev 2.2~2011week36-0ubuntu1 Web content engine library for Qt - development files
ii libqtwebkit4 2.2~2011week36-0ubuntu1 Web content engine library for Qt
ii qt4-demos 4:4.7.4-0ubuntu8.3 Qt 4 examples and demos
ii qt4-designer 4:4.7.4-0ubuntu8.3 graphical designer for Qt 4 applications
ii qt4-dev-tools 4:4.7.4-0ubuntu8.3 Qt 4 development tools
ii qt4-doc 4:4.7.4-0ubuntu8.3 Qt 4 API documentation
ii qt4-linguist-tools 4:4.7.4-0ubuntu8.3 Qt 4 Linguist tools
ii qt4-qmake 4:4.7.4-0ubuntu8.3 Qt 4 qmake Makefile generator tool
ii qt4-qmlviewer 4:4.7.4-0ubuntu8.3 Qt 4 QML viewer
ii qtcreator 2.2.1-1ubuntu4 lightweight integrated development environment (IDE) for Qt
ii qtcreator-doc 2.2.1-1ubuntu4 documentation for Qt Creator IDE
Is anything missing?
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?
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.
Re: How to cross-build for a different Linux version (w/ Qt Creator)?
Quote:
Originally Posted by
Hes
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.