Compiling QT libs with non-default gcc
I downloaded and extracted qt-everywhere-opensource-src-4.8.3.tar.gz.
Using configure (or another way) I want to compile the QTlibs with another gcc located in /opt
This is not the default gcc that comes with Centos (5.5)
Can you help ?
Adjust mkspecs (or better, create your own by copying, say, linux-g++), so that it uses a different compiler. Then you need to configure Qt with -platform <your new mkspecs>. I don't actually remember if it works, but at least is worth a try.
If your gcc in /opt is called "gcc", "g++" etc. then you can just make sure /opt/whatever/bin is in your PATH before /usr/bin and this should work. Run "gcc --version" (or was that "gcc -v", can't remember :) and check that you get the expected version number back to make sure the right compiler is picked up.
I would also check the generated Makefiles before building for the first time. Some mkspec put the absolute path to the compiler into those and will thus ignore your PATH setup.
I created a new folder under mkspecs copied from linux-g++-32
Then I changed g++,gcc to i686-nptl-linux-gnu-gcc,i686-nptl-linux-gnu-g++
I also set:
After a while I got the following error:
gmake: Entering directory
/home/zvivered/qt-everywhere-opensource-src-4.7.4/translations' /home/zvivered/qt-everywhere-opensource-src-4.7.4/bin/qmake -spec ../mkspecs/qws/linux-x86-g++ -o Makefile translations.pro gmake: Leaving directory/home/zvivered/qt-everywhere-opensource-src-4.7.4/translations'
gmake: Entering directory
/home/zvivered/qt-everywhere-opensource-src-4.7.4/translations' /home/zvivered/qt-everywhere-opensource-src-4.7.4/bin/lrelease assistant_cs.ts -qm assistant_cs.qm /home/zvivered/qt-everywhere-opensource-src-4.7.4/bin/lrelease: /usr/lib/libstdc++.so.6: versionGLIBCXX_3.4.9' not found (required by /home/zvivered/qt-everywhere-opensource-src-4.7.4/bin/lrelease)
gmake: *** [assistant_cs.qm] Error 1
gmake: Leaving directory `/home/zvivered/qt-everywhere-opensource-src-4.7.4/translations'
gmake: *** [sub-translations-make_default-ordered] Error 2
Why does the make files searches: /usr/lib/libstdc++.so.6 ?
In my directory under mkspec (called i686-nptl-linux-gnu) there is no: /usr/lib
You help is highly appreciated !
I think I had to set:
LD_LIBRARY_PATH to point to where my gcc's dynamic libraries are located.
Now I'm getting:
/home/zvivered/ct-ng-1.5.2/release/i686-nptl-linux-gnu/sys-root/lib/librt.so.1: undefined reference to `__fortify_fail@GLIBC_PRIVATE'
collect2: ld returned 1 exit status
gmake: *** [download] Error 1
"My" glibc is 2.9
Can I link QT 4.7.4 with this glibc ?
I created a toolchain with glib 2.5
With this glib I did not get the unresolved error: "undefined reference to `__fortify_fail@GLIBC_PRIVATE’"
Upon configure start I got the following message:
@You have not explicitly asked to use pkg-config and are cross-compiling.
pkg-config will not be used to automatically query cflag/lib parameters for
Where should I usg pkg-config ?