Problem linking application with Qt5 on OpenSUSE 13.2


I just shifted to OpenSUSE 13.2 from Ubuntu. My system currently has both Qt4 and Qt5 installed. When I try to build my application against Qt5, somehow the linker is also linking my applications to some unwanted Qt4 libs.

My output for ldd /usr/bin/digikam | grep Qt :

shourya@linux-91be:~/digikam-software-compilation/build> ldd /usr/bin/digikam | grep Qt => /usr/lib64/ (0x00007fc0ed874000) => /usr/lib64/ (0x00007fc0ed158000) => /usr/lib64/ (0x00007fc0ec8e4000) => /usr/lib64/ (0x00007fc0ec663000) => /usr/lib64/ (0x00007fc0ea4cc000) => /usr/lib64/ (0x00007fc0e7f55000) => /usr/lib64/ (0x00007fc0e6ebf000) => /usr/lib64/ (0x00007fc0e3b2d000) => /usr/lib64/ (0x00007fc0e2eda000) => /usr/lib64/ (0x00007fc0e22c1000) => /usr/lib64/ (0x00007fc0ddcc3000) => /usr/lib64/ (0x00007fc0dd44b000) => /usr/lib64/ (0x00007fc0db51e000) => /usr/lib64/ (0x00007fc0db2c3000) => /usr/lib64/ (0x00007fc0d9128000) => /usr/lib64/ (0x00007fc0d8b4d000) => /usr/lib64/ (0x00007fc0d8534000) => /usr/lib64/ (0x00007fc0d8317000) => /usr/lib64/ (0x00007fc0d6aa4000) => /usr/lib64/ (0x00007fc0d5de3000) => /usr/lib64/ (0x00007fc0d5bbb000) => /usr/lib64/ (0x00007fc0d56d0000)

As can be seen above, here digiKam is getting linked with the following Qt4 libs : => /usr/lib64/ (0x00007fc0d6aa4000) => /usr/lib64/ (0x00007fc0d5de3000) => /usr/lib64/ (0x00007fc0d5bbb000) => /usr/lib64/ (0x00007fc0d56d0000)

And this is unwanted. This used to not happen when I was in Ubuntu. When I was previously using Ubuntu, even there I had both Qt4 and Qt5 installed on my system. But the application used to link only to Qt5 libs. Can anyone help me out here as to what is going wrong ?

Thanks in advance !! :slight_smile:

Although I personally probably won’t be able to help much with Qt,
On general principles it might be helpful to post

The Desktop you’re using
The Development app
The compiler being used
If you have any additional repositories installed, particularly that might include their own Qt packages like KDE

If you don’t know about your repos, you can list them all with the following command

zypper lr -d


Desktop app : GNOME 3
Development app : digiKam 5.0.0 development version(which uses Qt5/Kf5)
Compiler : g++4.4
And yes I have also installed KDE frameworks 5, which requires Qt5. KF5 and Qt5 are required for digiKam 5.0.0.

The list of my repos can be found in this paste.

The Qt4 libraries are probably pulled in by opencv, which is built against Qt4 on openSUSE 13.2.
Make sure you install opencv-qt5-devel, instead of opencv-devel.

If that’s not it, there probably are more clues in the build log.

But why are you not just installing the existing package?
That’s the latest git snapshot, and it is even co-installable with the KDE4 version.
If you use my repo though, you should also add KDE:Qt5 and KDE:Frameworks5:

The list of my repos can be found in this paste.

Please remove the VideoLAN (VLC, #1) repo. This is incompatible with Packman, and anything in it is available from Packman anyway.

you got the digikam sources and are truing to build it your self?
afak the current stable digikam is qt4 you can get the qt5 version from wolfi’s kde5 repo

if you need to build it your self run ./configure --help in digikam5 source root and see the availoble switches, there should be a switch to chose between qt4 or qt5, do you have the qt5-devel packages installed?
imo it’s better to use the search and get prebuild packages then messing with the source
just search all the repo’s

Yes, you were right. The problem was that I was using opencv-devel, which is built against Qt4. Installling opencv-qt5-devel solved the problem. Thanks for the help !! :):slight_smile:

You’re welcome.

I did stumble over the same problem when first creating my digikam5 package months ago (causing digikam to crash at startup because it loaded Qt4 and Qt5), that’s why I was able to guess correctly… :wink: