Cannot mix incompatible Qt library (version 0x50501) with this library (version 0x50201) - qt

I have installed Shadowsocks-Qt5 within the code sudo apt-get install shadowsocks-qt5 in terminal, and then I can find the launch icon by searching, but it won't open when I click the icon. Then I tried to use terminal to open it, but the error comes out as below:
~ ss-qt5
Cannot mix incompatible Qt library (version 0x50501) with this library (version 0x50201)
[1] 8875 abort (core dumped) ss-qt5
I searched many answers but no one work. I think the key may be the default Qt library, but I don't know how to set default Qt library, the system on my computer is Ubuntu 14.04 LTS.
How to solve this problem?

I just had this error when attempting to run Qt Creator after doing a system update. For me, I was attempting to run Qt Creator 4.10.0-rc1 (based on Qt 5.13.1) that I had manually installed to ~/Qt along with Qt 5.13.0, and my system has Qt 5.12.2 installed.
I was getting the following error:
Cannot mix incompatible Qt library (version 0x50c02) with this library (version 0x50d00)
Doing an strace when running qtcreator.sh revealed that it was attempting to load plugins from the system directory. I finally discovered the culprit was the environment variable QT_PLUGIN_PATH was set (in my case to /usr/lib64/qt5/plugins:/usr/lib64/qt5/plugins/kcms).
After unsetting this variable, Qt Creator started up and worked.

After so many months of trying to fix this issue, this helped me.
sudo apt install qt5-style-plugins.

I was facing a similar issue, and even after 4 hours of debugging, I got nowhere. Finally, I found the following way to keep separate Qt versions, posting here so that other people find it.
Suppose you installed Qt in ${QtRoot}, extend the PATH and LD_LIBRARY_PATH:
export PATH=${QtRoot}/bin:${PATH}
export LD_LIBRARY_PATH=${QtRoot}/lib:${LD_LIBRARY_PATH}
You can make a wrapper function / script to manage separate Qt installations like this:
QtVersion=5.12.8
QtRoot="/scratch/Qt/${QtVersion}/gcc_64"
export PATH=${QtRoot}/bin:${PATH}
export LD_LIBRARY_PATH=${QtRoot}/lib:${LD_LIBRARY_PATH}
After running this your application will likely run fine.

Related

How to use QTermWidget with PyQt5?

I am trying to install https://github.com/lxqt/qtermwidget so that I can have a terminal widget to use with PyQt5. However, it does not seem to be possible to install without building myself, and when I try follow the instructions to build it myself, I get errors.
After doing cmake, I followed the instruction on qtermwidget's GitHub page to run sip-wheel inside the "pyqt" directory, but I get the error:
Querying qmake about your Qt installation...
sip-wheel: '12.11' is not a supported ABI version
What is the proper way to make "import QTermWidget" work inside python?
I got the same error when I used the sip-wheel to get qtermwidget Python binding. The problem is having different versions of PyQt and sip tools on the computer. I tested in a virtual machine with a clean version of Ubuntu, and I could build without problems. On my laptop, the solution was to create a virtual Python environment, install pyqt5, and sip tools again.

Run Binary With Specific QT Version - Cannot mix incompatible Qt library

I'm trying to replicate an application that we currently have running on a physical Ubuntu server using an Ubuntu machine in Virtual Box. It is a QT application but on the server we are running it using pm2 from NPM. After installing QT, and installing drivers needed for the application i've tried to run it but keep coming across this error:
Cannot mix incompatible Qt library (version 0x50701) with this library (version 0x50905)
I've inherited the code from someone else and don't want to change the project to QT5.9.5, so i'm trying to run with 5.7.1, I've followed instructions on other questions in order to change the QT version to 5.7.1 but still get the same error when running it.
I followed the instructions here:
https://unix.stackexchange.com/questions/116254/how-do-i-change-which-version-of-qt-is-used-for-qmake
When checking the QT version using "qmake -v" in the console I get the following output:
QMake version 3.0 Using Qt version 5.7.1 in /home/sam/Qt5.7.1/5.7/gcc_64/lib
So although it looks to me like i'm using the desired version of Qt (5.7.1), i'm still getting the incompatible library issue, i'm very new to all of this so apologies if this is a stupid question. If anyone could tell me what to do in order to use the compatible library that'd be great, thanks.
I will try to explain this in steps!
Each complete set of Qt libraries is called a Qt "distribution". You can get Qt distributions from a variety of sources:
Installed from the package manager of your OS (.deb/.rpm).
From a downloaded zip file on http://qt.io
As a cloned repo from git
etc..
Some of the available Qt distributions will come pre-built, and some will need to be built from sources. In either case they will all have a qmake program that is specific to that particular Qt distribution. This program is responsible for building programs so that they link to the particular Qt distribution that the qmake is part of. qmake is also used when building with QtCreator.
If you have a binary built with one qmake and you try to run it on another computer, it might find the wrong Qt libraries during dynamic linking and spit out errors of "incompatible version of Qt".
There are many solutions to this problem;
Collect all the Qt libraries (Mine are in /home/myusername/Qt/5.version/gcc_64/lib/*.so) in the same folder as your program executable. This will make sure they are prefered to any other version of Qt that may be in your dynamic linker's path.
Uninstall the OS supplied Qt version(s). This may not be advisable especially if other programs use them.
Rebuilt your program from source using the correct qmake.

Cross-compiling QtDeclarative for raspberry pi

I'm trying to cross compile qml for Raspberry pi 3 on a x64 Ubuntu.
I followed this tutorial
https://wiki.qt.io/RaspberryPi2EGLFS, installed Qt 5.6.3 and managed to run QtWidgets applications pretty easily and I'm now looking to use QML.
From what I understood, I need to install qtjsbackend and qtdeclarative for it to work so I cloned the github repositories and installed qtjsbackend without any trouble.
now, when I tried to run qmake on qtdeclarative, I got some weird errors:
/home/myname/raspi/qtdeclarative/src/src.pro:13: 'qtConfig' is not a recognized test function.
It keeps going on until:
Reading /home/myname/raspi/qtdeclarative/tests/auto/qml/debugger/qdebugmessageservice/qdebugmessageservice.pro
Project ERROR: Unknown module(s) in QT: qmldebug-private
I can't find anything on the internet about this, does anyone have an idea of what to do ?
The qtjsbackend requirement is old, and only needed for Qt 5.1. Newer qtdeclarative no longer use v8 as a JavaScript engine.
The error you are getting there is caused by a mismatch of version dependencies. You are trying to build a qtdeclarative that looks like it is from either a 5.8/5.9 or dev branch against a qtbase that you say is 5.6. If you have Qt 5.6, you want to build the same major & minor version for qtdeclarative, i.e. 5.6 (or a 5.6.x release)
I would suggest that you either use qt5.git to get you all the dependencies of the version that you need, or use the tarball releases which contain everything in one "blob".
Alternatively, you should be able to install it from your distribution. I would expect that it is already packaged there, though it may not be the newest version possible.
I faced same problem and tried following
Try checking out 5.7 branch from your git repo for qtdeclarative,
git checkout 5.7
then qmake, make and make install.
Hope this helps.
Cheers

Cannot cmake kde-connect

I am trying to install kde-connect following this.
Although my kubuntu version is 14.04, I wanted to compile them so that I can have the latest version. But when I followed the instructions to compile, i get the following error.
-- Found Qt-Version 5.2.1 (using /usr/bin/qmake)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
QT_QT_INCLUDE_DIR
used as include directory in directory /home/vinaychandra/Downloads/t/CMakeFiles/CMakeTmp
CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Error at /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:1311 (message):
Unable to compile a basic Qt application. Qt has not been found correctly.
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindKDE4.cmake:95 (find_package)
CMakeLists.txt:7 (find_package)
Please point out how to correct this.
I have tried giving -DQT_QT_INCLUDE_DIR=/usr/share/qt4/
then it tells that You must build your code with position independent code if Qt was built with -reduce-relocations.
Your cmake by default uses a different QT version.
So, you must explicitly tell him which version of QT he have to use for this job.
This one
-DQT_QT_INCLUDE_DIR=/usr/share/qt4/
Is wrong because you mustn't give QT position explicitly.
All you need is to use the right qmake.
So, give'em this flag and you'll be happy!
-DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4
Since most of kde applications are not ported to Qt5, you need Qt4.x for building kdeconnect(don't know x, mine is 4.8.6).
Also Qt4 installer is not available (I think !), so you have to build it also from source. Building Qt4 is quite easy, just download the source and run the usual commands.
After building it, it qmake name will be qmake-qt4 in /usr/bin.
So for building kdeconnect, first run its cmake, then a Cmaketextcache.txt file will form.
In that change the path of qmake (i.e somewhere written /usr/bin/qmake to /usr/bin/qmake-qt4) and also the path of qt include dir to (I think /usr/include/qt5 to /usr/include/qt4), and run the cmake again.
If some packages are missing, then you have to install it.
But with the above changes, you will get a make file to install it.
Unfortunately, the cited documentation is lagging behind the current state of kdeconnect. I ran into similar problems but I managed to solve them by installing the following required packages from the Kubuntu repositories:
sshfs
libfakekey-dev
libxtst-dev
libqca2-dev
libqjson-dev
I trust these are all of them. I installed kdeconnect from the latest git commit and it seems to run fine.
This answer comes a bit late, but this is the first Google search result for the question. In systems with qtchooser (Kubuntu, Ubuntu at least), this can be fixed by running first:
export QT_SELECT=qt4
This makes all of the Qt build tools to default to the Qt4 version instead of Qt5. You can check which Qt version is active by running:
qmake --version
Try kde connect install on ubuntu: https://fazlerabbi37.github.io/blogs/install_kde_connect_in_ubuntu_18.04.html
(in 18.04 & 19.04 it works with simple sudo apt install kdeconnect
Install kde connect on android device (google play store is where I installed from)
Invoke kde connect from desktop
Invoke kde connect from android and search device.
Your ubuntu will be found / initiating a search from desktop results in android phone pulled up for pairing
Accept pairing request
Provide access to folders
Try clicking on a video/image file for transfer
I could see the new file transferring in /Downloads folder of desktop
allowing/disallowing desktop to access sms, notifications etc are now a choice
Note: Pl treat this with pinch of salt. This appears very simple, effective for a main reason it worked for me in no time.

Qt compile error bits/c++config.h not found

I just installed Qt, Qt creator and g++ on the latest version of Mint, and attempted to compile the default hello world project. After configuring a compiler kit I get the following error:
bits/c++config.h: No such file or directiry
/usr/include/c++/4.7/utility
No surprise there is no such file at that location. It appears this is some sort of config file where you specify what architecture you're compiling for.
What package do I install, or how do I write or generate this config file?
c++config.h is not in /usr/include, but rather in an architechture-dependent path. What you need is one of the libstdc++ development packages. You have not specified your platform details but my guess is that what you need is libstdc++6-4.7-dev as the error message refers to 4.7. See full list of packages containing c++config.h under Ubuntu and Ubuntu-likes here.
I don't know of a specific package search for Mint but the Ubuntu one has hit the nail on the head for me.
edit: ah drat, I only noticed this was 8 months old immediately after I posted the answer. Is this bad?

Resources