7

I was compiling from sources qt-base. I build one of the tests (tst_qdom) and I got an error when executing. This is the result of ldd:

ldd tests/auto/xml/dom/qdom/tst_qdom

**tests/auto/xml/dom/qdom/tst_qdom: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by tests/auto/xml/dom/qdom/tst_qdom)
tests/auto/xml/dom/qdom/tst_qdom: /usr/lib/x86_64-linux-gnu/libQt5Test.so.5: no version information available (required by tests/auto/xml/dom/qdom/tst_qdom)
tests/auto/xml/dom/qdom/tst_qdom: /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5: no version information available (required by tests/auto/xml/dom/qdom/tst_qdom)**
linux-vdso.so.1 =>  (0x00007ffe5775f000)
libQt5Xml.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5 (0x00007f855e131000)
libQt5Test.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Test.so.5 (0x00007f855df08000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f855d862000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f855d55e000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f855d348000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f855cf83000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f855cd65000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f855cb4c000)
libicui18n.so.52 => /usr/lib/x86_64-linux-gnu/libicui18n.so.52 (0x00007f855c745000)
libicuuc.so.52 => /usr/lib/x86_64-linux-gnu/libicuuc.so.52 (0x00007f855c3cc000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f855c1c8000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f855bec0000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f855bcb8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f855b9b2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f855e36d000)
libicudata.so.52 => /usr/lib/x86_64-linux-gnu/libicudata.so.52 (0x00007f855a145000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f8559f07000)

Does someone know how to solve this problem? Googling was not useful for me.

EDITED:

This is the compile command of tst_qdom:

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_XML_LIB -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/home/pe/qtbase/tests/auto/xml/dom/qdom"' -I. -I../../../../../include -I../../../../../include/QtXml -I../../../../../include/QtTest -I../../../../../include/QtCore -I.moc -I../../../../../mkspecs/linux-g++ -o .obj/tst_qdom.o tst_qdom.cpp

g++ -Wl,-O1 -fuse-ld=gold -Wl,--enable-new-dtags -Wl,-rpath,/usr/local/Qt-5.7.0/lib -o tst_qdom .obj/tst_qdom.o   -L/home/pe/qtbase/lib -lQt5Xml -lQt5Test -lQt5Core -lpthread 
eyllanesc
  • 190,383
  • 15
  • 87
  • 142
pedret
  • 171
  • 1
  • 2
  • 7
  • 1
    Did you see this? http://stackoverflow.com/questions/137773/what-does-the-no-version-information-available-error-from-linux-dynamic-linker – Marco Oct 17 '15 at 17:37
  • Yes, but the question wasn't solved. I tried in another machine, but the same problem... I forgot to comment that the error also had at the end: ./tests/auto/xml/dom/qdom/tst_qdom: relocation error: ./tests/auto/xml/dom/qdom/tst_qdom: symbol _ZN5QTest17setMainSourcePathEPKcS1_, version Qt_5 not defined in file libQt5Test.so.5 with link time reference I did c++filt _ZN5QTest17setMainSourcePathEPKcS1_ and the result was: QTest::setMainSourcePath(char const*, char const*) – pedret Oct 17 '15 at 18:44
  • 1
    My idea is that you have compiled your test with a recent version of Qt but when you run it is picking the dynamic libraries from some other place, I suggest find out if you have different version of libQt5Core.so.5 installed and make sure your program uses ALL Qt libraries from the same version. – Marco Oct 18 '15 at 10:22
  • 1
    Thanks @Marco. I suppose the problem is that it is linking with the installed libraries instead of with the libraries in the obtained qt-base revision. What I mean is that I have an installed version in usr/lib/x86_64-linux-gnu/libQt5Core.so.5 and another in the directory of qt-base: ~/qtbase/lib/libQt5Core.so.5 and it is linking with the former instead of the latter. My installed version is 5.2.1 and the version in the qt-base directory is 5.7.0. But I don't know how can I indicate where to select those libraries... – pedret Oct 18 '15 at 15:56
  • 2
    From your command line looks like your are compiling with the 5.7 libs, but when you run the executable tst_qdom it is probably finding the installed 5.2.1, for what I remember an executable first looks in the current dir, then in the current PATH variable, unless is overhidden by the LD_LIBRARY_PATH so my suggestion is to set LD_LIBRARY_PATH=/usr/local/Qt-5.7.0/lib and then export LD_LIBRARY_PATH – Marco Oct 18 '15 at 20:56

3 Answers3

4

Thanks to @Marco I found the solution. He said to set LD_LIBRARY_PATH to /usr/local/Qt-5.7.0/lib. However, the problem was solved when I set LD_LIBRARY_PATH to /home/pe/qtbase/lib/ (the lib directory of the version I was compiling) and export the variable:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/pe/qtbase/lib; export LD_LIBRARY_PATH

Hope this help someone in the future and thanks to Marco again.

eyllanesc
  • 190,383
  • 15
  • 87
  • 142
pedret
  • 171
  • 1
  • 2
  • 7
4

you can made this permanent editing ~/.bashrc and including the following line

export LD_LIBRARY_PATH='/home/pe/qtbase/lib':$LD_LIBRARY_PATH; 

or made the same thing in

/etc/bash.bashrc and this will be permanent for all users!

Leonardo Hermoso
  • 808
  • 11
  • 24
4

Just make some change in bashrc according to below example

export LD_LIBRARY_PATH=/path/to/QT/gcc_64/lib/:$LD_LIBRARY_PATH
Alexander Farber
  • 18,345
  • 68
  • 208
  • 375
pyAddict
  • 1,146
  • 10
  • 13
  • So I am placing this in my .bashrc, i am having a moment here, can it go at the end after everything else executes? It will still work correct? – philm May 14 '20 at 23:53