Cannot mix incompatible Qt library (version 0x40701) with this library (version 0x40703)

I have the following problem:

I developed a small app with QtCreator and compiled it.
And when i run the application i got this error:

Cannot mix incompatible Qt library (version 0x40701) with this library (version 0x40703)
Aborted

??? :open_mouth: :frowning: :ā€™( ???
WTF!? What is this??
How to fix it???

I never had this problem before.

Check that your qt4 and qt4*devel packages all have the same version, thatā€™s what itā€™s complaining about, version incompatibility

same version
and still not work

SoftHacker wrote:
> same version
> and still not work
>
Can you double check with


rpm -qa | grep libqt

that all libqt packages are really the same version?
What version does your creator have?


rpm -q qt-creator

Did you ever compile qt core libraries which can conflict or shadow the libs
from the rpmā€™s (check /usr/local if there is something in lib or lib64 which
may conflict)?

ā€“
PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.3 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.3 | nVidia
ION | 3GB Ram

the folder /usr/local is empty
and all the installed libqt.*-packages are needed by other programs
so i canā€™t uninstall it

the QtSDK is installed to my home folder

Hello, SoftHacker, have you figured a workaround yet?

I have the same problem with my Qt programs, they compile but wonā€™t run, with the same error message.

no couldnā€™t figure it out
the problem is still here >:(

i donā€™t know anything about thisā€¦

For me (looking on ldd <mysoftwarename>) it seems like it tries to use couple of libraries from QTSDK (qt 4.7.3) and others - from /usr/lib64/. Right now Iā€™m looking into how to make it use /usr/lib* before QTSDK libs.

Before that, I tried all kinds of stuff, almost broke the whole system :slight_smile:

Graker wrote:

> QTSDK
You both speak always about the qt sdk without mentioning at all where you
have it from and how you installed it. It sounds as if you downloaded and
installed it from nokia or elsewhere instead of using qt-creator and the qt
development tools which come with the distribution (via yast or zypper).
Of course if you do that you have a near to 100% chance that you have chosen
a version which is incompatible with the rest of the system.
Of course I only guess that, I have no idea what you really have on your
system.

A warning, if you have somehow different versions of libraries in /usr/lib
than in /usr/lib64 you definitely screwed up your system. The libraries in
that folders should only differ in their ELF class (32 vs 64 bit) and NOT in
their version.

ā€“
PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram

Thatā€™s true, I installed QTSDK from qt.nokia.com and it came with qt 4.7.3 which is a source of the problem. I actually did that before, with openSUSE 11.2 and kubuntu 10.10, and it worked quite well. But if thereā€™s no proper way to do that now, I guess, thereā€™s no harm to fall back to repositories version.

Btw, SoftHacker, Iā€™ve found a dirty workaround for me. Do ldd <yourprogram>, find where the Qt 4.7.3 libs are located, it will be <qtpath>/Desktop/473/lib/ or something, and delete the lib/ directory. I know that is not very nice but worked for my program.

Graker wrote:

> Thatā€™s true, I installed QTSDK from qt.nokia.com and it came with qt
> 4.7.3 which is a source of the problem. I actually did that before, with
> openSUSE 11.2 and kubuntu 10.10, and it worked quite well. But if
> thereā€™s no proper way to do that now, I guess, thereā€™s no harm to fall
> back to repositories version.
>
For the other systems (11.2 and kubuntu) it just worked by accident, when
the random situation happens that what you download has the same version (or
a compatible one) as the linux distro.

The clever way is if you really want to build and run against the qt sdk and
its libraries not to copy them over somewhere into the system but to set the
correct environment variables such that your program looks up the qt
libraries at the place where you installed them. There are several ways to
achieve this, one would be to set
export LD_LIBRARY_PATH=/thepath/where/my/qt/libraies/live:${LD_LIBRARY_PATH}
just before the run of the program (but only for that and not as aglobal
setting!), this will shadow the qt libraries from openSUSE for this program
with their equivalents from your qt sdk.
Of course if you later want to deploy such a program you also have to deploy
all the qt libraries it needs as a dependency and ensure that the program is
started in a similar way on the machine you deploy it to (for example with a
starter script).

ā€“
PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram

I donā€™t know if this is of any help, but I had this error (as a user) installing SpiderOak. See here.

i also installed QtSDK from nokia.
i had installed opensuse 11.4 before and there was no problems
someday i have re-partitioned my whole 2 HDDs and to clean up all (windows xp, linux, ā€¦)
and than i installed opensuse 11.4 again, no more windows installed
and now i have this qt library problem | hmmā€¦ very strange

EDIT:

Btw, SoftHacker, I've found a dirty workaround for me. Do ldd <yourprogram>, find where the Qt 4.7.3 libs are located, it will be <qtpath>/Desktop/473/lib/ or something, and delete the lib/ directory. I know that is not very nice but worked for my program. 

youā€™re awesome this worked 100%, i can open my qt app
and all qt apps (qtcreator, linguist, designer, ā€¦) still work

i canā€™t thank you enough

<QtSDK_Path>/Desktop/Qt/473/gcc/lib

i renamed the lib folder instead of removing them :wink:

NOTE: qtcreator canā€™t compile anything with the libraries, so i have to rename the folder everytime to lib if i want to compile and than rename to to something like this __lib to run the app
this is very annoying, but i am happy that i can run qt apps

There is another solution:

  1. kdesu kwrite /etc/ld.so.conf and add line /opt/QtSDK/Desktop/Qt/473/gcc/lib (or another depending where your libraries are)
    2.** kdesu ldconfig** (to update cache)

In this way programs will alway look for libraries in /opt/QtSDK/Desktop/Qt/473/gcc/lib (4.7.3 version) before standard /usr/lib (4.7.1 version) and do not mix them.

thanks
it worked, but only if I add ā€œ/home/SoftHacker/QtSDK/Desktop/Qt/473/gcc/lib/ā€ before the first line :wink:
if i place it under /lib and /lib64 than, cannot mix incompatible qt libraries :\

thanks a lot

@SoftHacker great, but because of my solution I had a problem - dolphin: symbol lookup error: /usr/lib/libkdeinit4_dolphin.so: undefined symbol: _ZN6Phonon11VideoPlayer5eventEP6QEvent
And other programs can also break this way.

So there is better solution:
kdesu kwrite /usr/share/applications/Nokia-qtcreator.desktop
and edit Exec line to be: Exec=LD_LIBRARY_PATH=/opt/QtSDK/Desktop/Qt/473/gcc/lib:$LD_LIBRARY_PATH /opt/QtSDK/QtCreator/bin/qtcreator
Now all applications started with qtcreator will work.

If you want to be able manually execute such applications I suggest create new profile in Konsole and run programs from there (drop):

  1. Create file ExecWithNewQt.sh for example in /home/myname/Programs and fill with:

#!/bin/sh
export LD_LIBRARY_PATH=/opt/QtSDK/Desktop/Qt/473/gcc/lib:$LD_LIBRARY_PATH
bash

  1. Start Konsole -> Settings -> Configure Profiles -> New Profile -> Command: /bin/bash /home/myname/Programs/ExecWithNewQt.sh -> OK -> OK
    Try.

thanks for the tip, I will try itā€¦ :slight_smile:

Hallo! My knowledge of English is not very commendable but Iā€™ll still try using the Google translator to write an explanation of how to solve a problem that you have with the qt libraries. I had the same problem, I decided it in the following way: I installed the package Qt_SDK_Lin64_online_v1_1_2_en.run, a problem that occurs, occurs only with Qt_SDK_Lin64_offline_v1_1_2_en.run.
Also the source package works fine and I was testing it.
I am using opensuse 11.4 64bit. :slight_smile:

Bay