How to force 32bit target compiling & linking on 64bit platform (64bit Ubuntu 10.10 / Qt 4.7.0 / QtCreator 2.0.1)
-
Hello again, Alain-Pierre is back...
Tried same things under x86_64 Fedora 14, can't get successfull when compiling my Qt app with forcing 32bit mode with “-spec linux-g++-32” build profile option.
Buid process stops on compiling error about missing QtCore/qconfig-i386.hso, I made a new try opening a new bug report in Qt/Nokia bug tracking system:
http://bugreports.qt.nokia.com/browse/QTBUG-17747
Anymore help very appreciated.
Best regards.Alain-Pierre
-
Thanks again Volker for your suggestion,
might you have a crystal bowl ?
Qt team just answered quite same words as you for my QTBUG-17747
report/request:Oswald Buddenhagen added a comment - 24/Feb/11 5:52 PM
please try a self-compiled, unpatched qt from us. that you are seeing
different errors on different distributions is the best indication that you are
seeing (unrelated) packaging-related problems.Hmmmmm, okay okay...
It's not good news for me generally speaking...
So I'm going to forward my request to Fedora team, even if I will try to do
what you suggested to me...
What a maze...Regards,
Alain-Pierre
-
Ok Volker,
but what shall I download exactly (LGPL packages) from Qt web site ?- Qt SDK for Linux/X11 32-bit** (422 MB) ?
- Qt SDK for Linux/X11 64-bit** (530 MB) ?
- Qt libraries 4.7.1 for Linux/X11(202 MB) ?
- Qt libraries 4.7.1 for embedded Linux (202 MB) ?
What can be exactly concerned by what I have largely descripted
in my preceding posts ?Shall I re-generate Qt Creator ? qmake ? or only Qt libs ?
Shall I choose the 3ébit or 64bit package ?As you know, I try to generate x86 32bit targets with my daily working platform
being x86 64bit (Ubuntu or Fedora, not the matter), so what to do exactly ?About differences between different linux distros, would it be better/safer
to work with a true Debian platform ? Would it have less pbs about my Qt
disagreements than Fedora or Ubuntu ?Nice day / evening to you Volker (I'm going back to home now...)
:-)
Alain-Pierre
[EDIT: fixed list items, use '*' instead of '-', Volker]
-
Ahm, use neither of these :-)
Download the sources of the framework only:
- go to http://qt.nokia.com/downloads
- click on "go LGPL"
- on the right side is "Qt: Framework Only"
- the links to the sources are at the end of the introductory paragraph
Then unpack the archive, and follow the "installation guide":http://doc.qt.nokia.com/4.7/installation.html. No need to recompile creator etc. qmake is built with every Qt installation you have.
Once your compiler has finished and you have issued "make install", make the new Qt version visible to Qt creator: Go to the preferences, Qt 4 and hit the "+"-button and enter the full path to the newly built qmake (usually under /usr/local/Trolltech/Qt-4.7.1/bin) and give it a good name ("4.7.1 32bit" comes into mind).
Then - important! - go to the project view in Creator and change the version used to the newly added one! If you forget this, your project will still be compiled against the 64 bit system Qt!
-
Hello Volker,
Fedora team has also closed my "bug report" because in case of Fedora (14), the solution is already existing...
As Kevin Kofler said when closing the bug report :
.......................................................................
CLOSED NOTABUGKevin Kofler 2011-02-24 13:41:26 EST
su -c "yum install qt-devel.i686"
.......................................................................:-) it works fine now, installing the qt-devel.i686 package did the job !
Then, I 'm wondering now what would be the equivalent package to install, if ever possible/available, to solve the problem same way on Ubuntu (10.10) ?
Without lights from Ubuntu team, I'll try what you proposed to me Volker and I'll inform you about working results.
Have a nice w-e !
Alain-Pierre
-
Just (re)built my own Qt lib (and, more complicated, qvfb tool) for my Fedora 14
http://developer.qt.nokia.com/forums/viewthread/4115/
:-)
Alain-Pierre
-
Hello again,
it seems that the two download links relative to "Qt libraries 4.7.1 for Linux/X11(202 MB)" and "Qt libraries 4.7.1 for embedded Linux (202 MB)"
on the official LGPL Qt download pages will download the same "qt-everywhere-opensource-src-4.7.1.tar.gz" compressed archive file :is this ok ?
And what to do when configuring the make process ?
How to proceed when issuing the "./configure" command if wanting to build a "normal" Qt-X11 lib kit AND a Qt-embedded lib kit ? Is it by adding a "-embedded" option and indicating different target paths for the normal and embedded targets ?
As I understand, default target path will be something like "/usr/local/Trolltech/Qt-4.7.1", but how to specify a different path ?
Also, for what target may I specify a (the) "-qvfb" option ? Is it for the normal Qt-X11 one or for the embedded one ?
All these details are not clear at all in my mind.
Thanks for any lights about that, regards.Alain-Pierre
-
Did you have a look at the output of
@
./configure -help
@Hint: -prefix is your friend. This way you can install multiple Qt variants of the same version on your system.
To compile for specific system/system variant, use -platform and the same argument as you would for qmake -spec.
EDIT: The source packages are always the same, it does not matter where you get them.
-
Hello again Volker,
- so, I try again to generate my own Qt lib as following :
./configure -platform linux-g++-32 -qvfb ; gmake ; gmake install
Which edition of Qt do you want to use ?Type 'c' if you want to use the Commercial Edition.
Type 'o' if you want to use the Open Source Edition.o
This is the Qt for Linux/X11 Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU General Public License (GPL) versions 3.Type '3' to view the GNU General Public License version 3.
Type 'L' to view the Lesser GNU General Public License version 2.1.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.Do you accept the terms of either license? yes
Creating qmake. Please wait...
g++ -c -o project.o -m32 -pipe -DQMAKE_OPENSOURCE_EDITION -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -I/home/aoip/qt-everywhere-opensource-src-4.7.1/include -I/home/aoip/qt-everywhere-opensource-src-4.7.1/include/QtCore -I/home/aoip/qt-everywhere-opensource-src-4.7.1/src/corelib/global -I/home/aoip/qt-everywhere-opensource-src-4.7.1/src/corelib/xml -I/home/aoip/qt-everywhere-opensource-src-4.7.1/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/home/aoip/qt-everywhere-opensource-src-4.7.1/mkspecs/linux-g++-32 -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT project.cpp
g++ -c -o property.o -m32 -pipe -DQMAKE_OPENSOURCE_EDITION -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -I/home/aoip/qt-everywhere-opensource-src-4.7.1/include -I/home/aoip/qt-everywhere-opensource-src-4.7.1/include/QtCore -I/home/aoip/qt-everywhere-opensource-src-4.7.1/src/corelib/global -I/home/aoip/qt-everywhere-opensource-src-4.7.1/src/corelib/xml -I/home/aoip/qt-everywhere-opensource-src-4.7.1/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/home/aoip/qt-everywhere-opensource-src-4.7.1/mkspecs/linux-g++-32 -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT property.cpp...
...
...(to be continued)
-
- but it is stopping for obscure reason I don't know what to think about :
g++ -c -o qxmlutils.o -m32 -pipe -DQMAKE_OPENSOURCE_EDITION -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -I/home/aoip/qt-everywhere-opensource-src-4.7.1/include -I/home/aoip/qt-everywhere-opensource-src-4.7.1/include/QtCore -I/home/aoip/qt-everywhere-opensource-src-4.7.1/src/corelib/global -I/home/aoip/qt-everywhere-opensource-src-4.7.1/src/corelib/xml -I/home/aoip/qt-everywhere-opensource-src-4.7.1/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/home/aoip/qt-everywhere-opensource-src-4.7.1/mkspecs/linux-g++-32 -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT /home/aoip/qt-everywhere-opensource-src-4.7.1/src/corelib/xml/qxmlutils.cpp
g++ -o "/home/aoip/qt-everywhere-opensource-src-4.7.1/bin/qmake" project.o property.o main.o makefile.o unixmake2.o unixmake.o mingw_make.o option.o winmakefile.o projectgenerator.o meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o borland_bmake.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfile.o qfsfileengine_unix.o qfsfileengine_iterator_unix.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qlibraryinfo.o qvariant.o qvsnprintf.o qlocale.o qlinkedlist.o qurl.o qnumeric.o qcryptographichash.o qxmlstream.o qxmlutils.o -m32
Basic XLib functionality test failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/aoip/qt-everywhere-opensource-src-4.7.1/mkspecs/linux-g++-32.
/home/aoip/qt-everywhere-opensource-src-4.7.1/bin/qmake -spec mkspecs/linux-g++-64 -o Makefile projects.pro
cd /src/tools/bootstrap/ && /home/aoip/qt-everywhere-opensource-src-4.7.1/bin/qmake /src/tools/bootstrap/bootstrap.pro -spec /home/aoip/qt-everywhere-opensource-src-4.7.1/mkspecs/linux-g++-64 -o Makefile
Cannot find file: /src/tools/bootstrap/bootstrap.pro.
gmake: *** [/src/tools/bootstrap/Makefile] Erreur 2
cd /src/tools/bootstrap/ && /home/aoip/qt-everywhere-opensource-src-4.7.1/bin/qmake /src/tools/bootstrap/bootstrap.pro -spec /home/aoip/qt-everywhere-opensource-src-4.7.1/mkspecs/linux-g++-64 -o Makefile
Cannot find file: /src/tools/bootstrap/bootstrap.pro.
gmake: *** [/src/tools/bootstrap/Makefile] Erreur 2
[root@vbox-fedora14-64b qt-everywhere-opensource-src-4.7.1]#-
What is "/src/tools/bootstrap/bootstrap.pro" relative to ?
-
What about "Basic XLib functionality test failed!" ?!
-
Following the "Basic XLib functionality test failed!" message, why the make procedure suddenly switches to 64bit compiling mode ?!
:-(
I've read the README file as suggested by the "-help" option of the configure script against the "-platform" option, but it is just directing us to a Qt/Nokia link relative to "tier1/2/3" groups of supported platforms, which is not saying anything about what "values" to set for the "-platform" option... Hu ?
- So, if I'm understanding your last post, I decided to specify "-platform linux-g++-32" to make the build procedure compiling Qt lib sources as 32bit x86 target ? It seems it was "ok" because gcc using "-m32" flag as a result untill the "XLib" problem... Was it supposed to be ok ?
And I still don't know if "-qvfb" is a valid option for the configure script ?
And even when I regenerate and relink the "qvfb" tool with my own built Qt lib (64bit by default when not trying to force the -platform option), my generated applications will not connect to the running qvfb... I was supposing that 32bit generated apps cannot connect to a 64bit qvfb, that is the reason I would build my own Qt lib as 32bit x86 target mode, relink my apps with hat own 32bit Qt lib, rebuild/relink the qvfb with that same own 32bit Qt lib, and then, trying to make my 32bit builtQt app run inside qvfb virtual frame buffer.
Lesser and lesser understanding, still not found the way-out, like a mouse in a maze...
Alain-Pierre
-
That bootstrap.pro is to .... tada... bootstrap Qt :-) It basically creates some tools that are needed in the further build process.
So, no working XLib ... it's what it states. Seems you do not have a 32bit version of XLib installed. And now the two well known options: Look if your distro has a 32bit version or compile yourself. But I seriously doubt this is the last library that bails out...
Did you consider setting up a virtual machine and install a native 32bit version of your Linux distro? That would save you a big bunch of further hassles...
-
I was in fact in opposite situation: I was working on a true Fedora 8 system running on a 3Ghz Pentium 4 pc and I was logging to that linux system with ssh / Putty and X11 rendering on my own workstation (Dell Vostro PC) which is a Win Seven 64 bits powered by a quadcore cpu (2.8 Ghz Core-i7)... This is a little strange, no ?
All the Qt Creator, qmake and other Qt/Linux tools run on a single cpu and we are using a multicore cpu machine as a X11 rendering terminal...
So, what I was trying was to "duplicate" the Fedora 8 platform as virtual platform (64bit Ubuntu 10.10 & 64bit Fedora 14) under VirtualBox on the multicore pc workstation to benefit of the multicore power and not having to use Putty which often crashes unexpectingly under Win Seven 64bit !? Or, may be, there is a problem between the XMing server and Putty/SSH ?Before Win Seven 64bit, I was using a desktop pc with 32bit Win XP system powered by an Athlon64-X2 cpu and Putty was never crashing...
IT'S THE REASON why I tried to work with "direct" virtual Linux platforms on my new Win Seven 64 system multicore workstation, and thus, I thought "why not trying modern 64bit Linux platforms like latest Ubuntu and/or Fedora systems with VirtualBox ?
You know what is the result about 32bit vs 64bit compatibility problems I've been encountering doing so...
Thus, effectively, I may try a "normal" 32bit Linux platform virtualized by mean of VirtualBox... May be I could simply mirror our true Fedora 8 server as a virtual image being run under VrtualBox...
What a pity !
Thank you again Volker for your help which was really valuable concerning Qt libs and tools.
:-)
A-P.
-
Hi All,
I am having the same problem. I am working on X86_64, compiling the C++ files for 32-bit ARM.
In fact I am using Qt_Embedded.
@ubuntu:~/qt-target$ make
cd /src/tools/bootstrap/ && /home/post4pavan/qt-target/bin/qmake /src/tools/bootstrap/bootstrap.pro -spec /home/post4pavan/qt-target/mkspecs/qws/linux-mxc-g++ -o Makefile
Cannot find file: /src/tools/bootstrap/bootstrap.pro.
make: *** [/src/tools/bootstrap/Makefile] Error 2@I have Xlib dev,dbg needed.
Could not find what went wrong.
Please Suggest! -
I avoid these types of problems by developing in chroot environments, using the schroot debian package to help with the setup.
Basically I create a separate (32 or 64bit) linux installation on my ubuntu per project I work on. That way I detect dependency changes in projects pretty easily (as each installation only contains the development stuff needed for that project), it allows to test code using different distributions and it greatly simplifies building 32bit software on my 64bit machine. After all is the whole chroot is 32bit then it can not pick up 64bit libraries anywhere;-)
Debbootstrap is a really simple way to set up such chroots that works great for both debian and ubuntu in all kinds of flavors;-)