首先安装所有的qt开发库:
sudo apt-get install git build-essential cmake qt5-default qtscript5-dev libssl-dev qttools5-dev qttools5-dev-tools qtmultimedia5-dev libqt5svg5-dev libqt5webkit5-dev libsdl2-dev libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack-jackd2-dev libxrandr-dev libqt5xmlpatterns5-dev libqt5xmlpatterns5 libqt5xmlpatterns5-private-dev
例如:
Qt5Core上的CMake错误
问题
我试图使用CMake构建使用Qt5的源代码。它退出了这个错误:
CMake Error at CMakeLists.txt:20 (find_package) By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Core", but CMake did not find one. Could not find a package configuration file provided by "Qt5Core" with any of the following names: Qt5CoreConfig.cmake qt5core-config.cmake Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set "Qt5Core_DIR" to a directory containing one of the above files. If "Qt5Core" provides a separate development package or SDK, be sure it has been installed.
解
我检查了Qt5包,似乎安装了。Ubuntu中的Qt4和Qt5软件包之间的命名有所改变,并将其抛弃。
需要的是包装qtbase5-dev。一旦我安装它,这个错误解决了:
$ sudo apt install qtbase5-dev