I have an error when I run cmake ... Could you please help me? Thanks so much

I want to build my project. I use mkdir build, cd build/ and cmake ...Then I got this error:

CMake Error at /usr/share/cmake-3.16/Modules/FindQt4.cmake:1314 (message):
  Found unsuitable Qt version "5.12.8" from /usr/bin/qmake, this code
  requires Qt 4.x
Call Stack (most recent call first):
  CMakeLists.txt:8 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/home/jingsheng/src/build/CMakeFiles/CMakeOutput.log".

After that, I check my QT version with qmake --version. Then I got:

QMake version 3.1
Using Qt version 5.12.8 in /usr/lib/x86_64-linux-gnu

My OS is Ubuntu 20.04 LTS. Could you please help me, how could I do?

  • Which application are you trying to compile? Is it available somewhere online? – N0rbert Feb 20 at 9:32
  • No, it is the project from my uni. We want to implement the robot motion planning using RRT connect. I want to extend the method of the basic RRT algorithm. – Jensen Lyu Feb 20 at 9:36
  • You can try to use the method from my answer below, but it may not work because of Qt4 EOL. – N0rbert Feb 20 at 9:37

The Qt4 packages are available from third party PPA. You have to add it with:

sudo add-apt-repository ppa:rock-core/qt4
sudo apt-get update

and then install necessary development package

sudo apt-get install libqt4-dev qt4-qmake qt4-dev-tools
  • Thanks so much for your help. I try to do your command. After that, it has also the same error. – Jensen Lyu Feb 20 at 9:45
  • You have to try installing Ubuntu 18.04 LTS in VM to compile your application. – N0rbert Feb 20 at 15:44
  • Thanks so much for your help. I have already fixed this error with rebuild my project. Now it works. I don't get this error anymore. Have a nice day. – Jensen Lyu Feb 20 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.