[Marble-devel] Marble linking against wrong version of Qt
Josh Knox
jknox at lauferwind.com
Mon Jun 3 21:16:01 UTC 2013
Hi!
In my project I'm using a local build of Qt 4.8.4. I have it installed
in /opt/Qt/4.8.4. When I build Marble, I put the location of qmake for
this version on my path:
export PATH=/opt/Qt/4.8.4/bin:$PATH
The correct version of Qt is found:
%> which qmake
/opt/Qt/4.8.4/bin/qmake
When I run cmake it finds the correct version:
%> cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=TRUE \
-DCMAKE_INSTALL_PREFIX=/opt/marble ../marble-stable/sources
...
...
Found Qt4: /opt/Qt/4.8.4/bin/qmake (found version "4.8.4")
...
...
make runs fine but when I run it with the rest of my application, also
built against my Qt4.8.4 build I get this runtime error:
Cannot mix incompatible Qt library (version 0x40801) with this
library (version 0x40804)
Aborted (core dumped)
And indeed I discover that the marble libs are linked against the
system's Qt. Here's the ldd for my app and the marble lib I built:
%> ldd /opt/lw/bin/playtracks
...
...
libmarblewidget.so.15 => /opt/marble/lib/libmarblewidget.so.15
(0x00007f90bef3b000)
libQtGui.so.4 => /opt/Qt/4.8.4/lib/libQtGui.so.4
(0x00007f90be3ac000)
%> ldd /opt/marble/lib/libmarblewidget.so
linux-vdso.so.1 => (0x00007fff77fff000)
libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4
(0x00007f175e34e000)
libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4
(0x00007f175d680000)
libQtXml.so.4 => /usr/lib/x86_64-linux-gnu/libQtXml.so.4
(0x00007f175d43c000)
libQtSvg.so.4 => /usr/lib/x86_64-linux-gnu/libQtSvg.so.4
(0x00007f175d1e4000)
libQtNetwork.so.4 =>
/usr/lib/x86_64-linux-gnu/libQtNetwork.so.4 (0x00007f175ce98000)
Note the different Qt libraries. Therein lies my problem. The marble
build doesn't link with the Qt it found during the cmake pass.
So, my question is how to get marble to build against my Qt version
rather than the system's version.
Thanks!
Josh
More information about the Marble-devel
mailing list