系统环境说明
系统:Deepin V20.6
平台:amd64
GCC
版本:8.3.0
Clang
版本:13.0.1
Qt
版本:5.12.3
qmake
版本:3.1
编译工具安装
sudo apt install cmake
编译工具安装
- 编译安装
llvm
见deepinV20.6编译安装llvm8.x - 编译安装
Qt
见在deepinV20.6编译安装Qt5.12.3
迁出源代码
git clone https://gitee.com/mirrors/qt-creator.git
编译
cd /path/to/qt-creator
# 切换4.13分支
git checkout 4.13
mkdir build
cd build
cmake \
-D CMAKE_BUILD_TYPE=Release \
-D PYTHON_EXECUTABLE=/bin/python3 \
-D CMAKE_INSTALL_PREFIX=~/App/Qt-creator4.13 \
..
cmake --build . --target install
配置环境变量
echo "export PATH=~/App/Qt-creator4.13/bin:\$PATH" >> ~/.bashrc
测试
source ~/.bashrc
#qmake --version
常见错误处理
- 编译报如下错误
Could not find a package configuration file provided by "Qt5Qml" with any
of the following names:
Qt5QmlConfig.cmake
qt5qml-config.cmake
解决方案
cd /path/to/qt-everywhere-src-5.12.3/qtdeclarative
qmake .
make -j8
make install
- 编译报如下错误
No python3 interpreter found, skipping extraction of data from XML and JSON
files.
*** Please pass -DPYTHON_EXECUTABLE=/path/to/python3 to cmake.
解决方案
按提示添加 -D PYTHON_EXECUTABLE=/bin/python3
参数
- 编译报如下错误
Failed to find Qt5 component "LinguistTools" config file at
"/home/dev/App/Qt5.12.3/lib/cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake"
解决方案
cd /path/to/qt-everywhere-src-5.12.3/qttools
qmake .
make -j8
make install