linux qt开发环境
时间: 2023-10-08 13:06:44 浏览: 129
Linux上搭建Qt开发环境,可以按照以下步骤进行:
1. 安装必要的依赖项:
使用以下命令安装必要的依赖项:
```
sudo apt-get install build-essential libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev gdb cmake libdtkwidget-dev qt5-default qtcreator
```
2. 安装Qt:
下载Qt安装文件,并将其解压到主目录下。然后打开终端,进入解压后的文件夹,并执行以下命令:
```
sudo ./configure
yes
sudo make
sudo make install
```
3. 安装Qt Creator:
下载Qt Creator安装文件,并将其复制到主目录下。然后在终端中运行以下命令:
```
./qt-creator-linux-x86-opensource-2.4.1.bin
```
安装路径选择`/usr/local/Trolltech/QtCreator`。
4. 设置环境变量:
打开终端,并输入以下命令:
```
sudo gedit ~/.bashrc
```
在文件末尾添加以下内容:
```
export QTDIR=/usr/local/Trolltech
export PATH=$QTDIR/Qt-4.7.4/bin:$QTDIR/qtcreator-2.4.1/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/Qt-4.7.4/lib:$QTDIR/qtcreator-2.4.1/lib:$LD_LIBRARY_PATH
```
5. 设置关联:
运行Qt Creator,点击“工具”->“选项”->“构建和运行”->“Qt版本”->“手动设置”->“添加”,选择`/usr/local/Trolltech/Qt-4.7.4/bin/qmake`。
这样,你就成功搭建了Linux上的Qt开发环境。请注意,根据你的实际情况,可能需要调整一些路径和版本号。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Linux上从零搭建QT开发环境](https://blog.csdn.net/m0_73443478/article/details/127659413)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [【Qt】 在Linux上搭建Qt开发环境](https://blog.csdn.net/WangPaiFeiXingYuan/article/details/130432355)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文