[Marble-devel] Marble linking against wrong version of Qt

Josh Knox jknox at lauferwind.com
Wed Jun 5 15:20:00 UTC 2013


Hi Dennis,

Thanks for that tip. It led me to a solution.

I was intentionally avoiding LD_LIBRARY_PATH. My application builds the 
rpath into my libs. I forgot that I needed to do this for my marble 
build as well.

So I added "-DCMAKE_INSTALL_RPATH=/opt/Qt/4.8.4/lib" to marble's cmake args.
This got the rpath set correctly.

Things are working now!

Thanks!

Josh

On 06/04/2013 11:15 AM, Dennis Nienhüser wrote:
> Hi,
>
> is /opt/Qt/4.8.4/lib part of the library search path?
> Try LD_LIBRARY_PATH=/opt/Qt/4.8.4/lib ldd
> /opt/marble/lib/libmarblewidget.so | grep Qt
>
> Regards,
> Dennis
>
> Am 04.06.2013 16:13, schrieb Josh Knox:
>> On 06/03/2013 05:16 PM, Josh Knox wrote:
>>> 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
>>>
>>> _______________________________________________
>>> Marble-devel mailing list
>>> Marble-devel at kde.org
>>> https://mail.kde.org/mailman/listinfo/marble-devel
>>>
>>>
>>
>> Some more details:
>>
>> If I query cmake for variables referring to Qt libraries, it all
>> refers to the correct libraries for my build:
>>
>> %> cmake -LA | grep Qt | grep ".so"
>>
>> PHONON_LIBRARY:FILEPATH=/opt/Qt/4.8.4/lib/libphonon.so
>> QT_PHONONWIDGETS_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/designer/libphononwidgets.so
>>
>> QT_PHONON_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libphonon.so
>> QT_PHONON_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libphonon.so
>> QT_QCNCODECS_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/codecs/libqcncodecs.so
>>
>> QT_QDECLARATIVEVIEW_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/designer/libqdeclarativeview.so
>>
>> QT_QGENERICBEARER_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/bearer/libqgenericbearer.so
>>
>> QT_QGIF_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/imageformats/libqgif.so
>>
>> QT_QGLGRAPHICSSYSTEM_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/graphicssystems/libqglgraphicssystem.so
>>
>> QT_QICO_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/imageformats/libqico.so
>>
>> QT_QJPCODECS_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/codecs/libqjpcodecs.so
>>
>> QT_QJPEG_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/imageformats/libqjpeg.so
>>
>> QT_QKRCODECS_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/codecs/libqkrcodecs.so
>>
>> QT_QMNG_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/imageformats/libqmng.so
>>
>> QT_QSQLITE2_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/sqldrivers/libqsqlite2.so
>>
>> QT_QSQLITE_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/sqldrivers/libqsqlite.so
>>
>> QT_QSQLODBC_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/sqldrivers/libqsqlodbc.so
>>
>> QT_QSVGICON_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/iconengines/libqsvgicon.so
>>
>> QT_QSVG_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/imageformats/libqsvg.so
>>
>> QT_QT3SUPPORTWIDGETS_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/designer/libqt3supportwidgets.so
>>
>> QT_QT3SUPPORT_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQt3Support.so
>> QT_QT3SUPPORT_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQt3Support.so
>> QT_QTCLUCENE_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtCLucene.so
>> QT_QTCLUCENE_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtCLucene.so
>> QT_QTCORE_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtCore.so
>> QT_QTCORE_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtCore.so
>> QT_QTDECLARATIVE_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtDeclarative.so
>> QT_QTDECLARATIVE_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtDeclarative.so
>>
>> QT_QTDESIGNERCOMPONENTS_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtDesignerComponents.so
>>
>> QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtDesignerComponents.so
>>
>> QT_QTDESIGNER_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtDesigner.so
>> QT_QTDESIGNER_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtDesigner.so
>> QT_QTGUI_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtGui.so
>> QT_QTGUI_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtGui.so
>> QT_QTHELP_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtHelp.so
>> QT_QTHELP_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtHelp.so
>> QT_QTIFF_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/imageformats/libqtiff.so
>>
>> QT_QTMULTIMEDIA_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtMultimedia.so
>> QT_QTMULTIMEDIA_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtMultimedia.so
>>
>> QT_QTNETWORK_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtNetwork.so
>> QT_QTNETWORK_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtNetwork.so
>> QT_QTOPENGL_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtOpenGL.so
>> QT_QTOPENGL_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtOpenGL.so
>> QT_QTRACEGRAPHICSSYSTEM_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/graphicssystems/libqtracegraphicssystem.so
>>
>> QT_QTSCRIPTTOOLS_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtScriptTools.so
>> QT_QTSCRIPTTOOLS_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtScriptTools.so
>>
>> QT_QTSCRIPT_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtScript.so
>> QT_QTSCRIPT_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtScript.so
>> QT_QTSQL_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtSql.so
>> QT_QTSQL_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtSql.so
>> QT_QTSVG_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtSvg.so
>> QT_QTSVG_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtSvg.so
>> QT_QTTEST_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtTest.so
>> QT_QTTEST_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtTest.so
>> QT_QTWCODECS_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/codecs/libqtwcodecs.so
>>
>> QT_QTWEBKIT_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtWebKit.so
>> QT_QTWEBKIT_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtWebKit.so
>> QT_QTXMLPATTERNS_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtXmlPatterns.so
>> QT_QTXMLPATTERNS_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtXmlPatterns.so
>>
>> QT_QTXML_LIBRARY:STRING=/opt/Qt/4.8.4/lib/libQtXml.so
>> QT_QTXML_LIBRARY_RELEASE:FILEPATH=/opt/Qt/4.8.4/lib/libQtXml.so
>> QT_QWEBVIEW_PLUGIN_RELEASE:FILEPATH=/opt/Qt/4.8.4/plugins/designer/libqwebview.so
>>
>>
>>
>> Unfortunately the final libmarblewidget build result is still linked
>> against the incorrect system Qt:
>>
>> %> ldd  /opt/marble/lib/libmarblewidget.so | grep Qt
>>         libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4
>>         libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4
>>         libQtXml.so.4 => /usr/lib/x86_64-linux-gnu/libQtXml.so.4
>>         libQtSvg.so.4 => /usr/lib/x86_64-linux-gnu/libQtSvg.so.4
>>         libQtNetwork.so.4 => /usr/lib/x86_64-linux-gnu/libQtNetwork.so.4
>>         libQtWebKit.so.4 => /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
>>
>> libQtDeclarative.so.4=>/usr/lib/x86_64-linux-gnu/libQtDeclarative.so.4
>>         libQtScript.so.4 => /usr/lib/x86_64-linux-gnu/libQtScript.so.4
>>         libQtSql.so.4 => /usr/lib/x86_64-linux-gnu/libQtSql.so.4
>>         libQtXmlPatterns.so.4 =>
>> /usr/lib/x86_64-linux-gnu/libQtXmlPatterns.so.4
>>
>>
>>
>> Still digging....
>>
>>
>> Josh
>> _______________________________________________
>> Marble-devel mailing list
>> Marble-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/marble-devel
>>
>
>
>



More information about the Marble-devel mailing list