3

I am intending to use Qt Jambi to write Qt GUIs in Java.

I have the latest Qt libraries installed on my Linux OS which is currently version 4.7.4. Qt Jambi is, however, only available as version 4.7.0 on the download page.

Now when I run my Qt application I get the following error:

Cannot mix incompatible Qt library (version 0x40704) with this library (version 0x40700)

So it seems there is no up-to-date version of Qt Jambi. Is this because of the fact that it is not officially supported any more?

As a solution one could build it from source but I wonder if it was then compatible with the installed version of Qt.

Now can I somehow mix those versions despite the error message? If not how do you achieve matching version numbers? As far as I know, Jambi is only available for Ubuntu as a binary package and on other Linux platforms has to be deployed along with the application jar (as fixed version).

foowtf
  • 399
  • 1
  • 9
  • 4
    One thing you can try is to extract the native jar and use chrpath to remove rpaths and runpaths from those libs and then use LD_LIBRARY_PATH to run against the directory where all those libs are. Those older releases are IIRC still bundled with libs that have rpaths set, so they don’t work properly if there is system Qt present. – Smar Oct 20 '11 at 18:00
  • Which distro you have, btw? I take it as not Ubuntu as Ubuntu packages are no go? – Smar Oct 20 '11 at 18:07
  • You are right, if I remove the rpaths from the native libraries and run the application with LD_LIBRARY_PATH set it works. Using -Djava.library.path results in the same error message, though. By "older releases" do you mean following Qt Jambi versions won't have this problem? The only available version is 4.7.0 for Linux, perhaps the Ubuntu packages are newer. To answer your question I'm using ArchLinux. – foowtf Oct 20 '11 at 22:48
  • Sorry, no new releases until now, we are trying our best to do some in following months. – Smar Oct 20 '11 at 23:11
  • can you elaborate on that? I used chrpath -d on all native libraries in qtjambi-linux64-gcc.4.7.0.jar but it didn't solve problem. The thing is I can run some qt examples but e.g. media-player doesn't work. – pzo Feb 04 '12 at 15:52

1 Answers1

1

Being a community driven fork, Qt-Jambi is slightly behind the official Qt in development.

Qt-Jambi should come pre-packaged with the correct Qt libraries, but it seems your application is referencing the most recent Qt libraries already installed on your system. You can't mix different versions, so you need to reference the same version of the Qt binaries.

If you aren't explicitly referencing the new Qt libraries in your build environment, you should modify the LD_LIBRARY_PATH environment variable to include the path with the correct libraries.

Rob
  • 5,223
  • 5
  • 41
  • 62
  • 1
    Or use -Djava.library.path which might be more suitable for Java applications. But those are not exactly solutions for the problem, just a way to go around the problem. The jar is extracted to /tmp, but something is preventing of properly using them, my guess is rpath thingys. – Smar Oct 20 '11 at 19:52