自学内容网 自学内容网

Ubuntu22.04搭建CLion C++开发环境

Ubuntu22.04搭建CLion C++开发环境

1.首先下载CLion

进入官网https://www.jetbrains.com/clion/download/#section=linux

Image

然后进入自己存放这个压缩包的路径中,

sudo mkdir /opt/clion
sudo tar -zxvf CLion-2024.1.tar.gz -C /opt/clion

然后运行启动

sh /opt/clion/clion-2024.1/bin/clion.sh 

2.配置c++环境

确保已经安装了cmakegccg++

sudo apt install make
sudo apt install gcc
sudo apt install g++

启动CLion后,进入File > Settings > Build, Execution, Deployment > Toolchains,配置如下:

/usr/bin/make
/usr/bin/gcc
/usr/bin/g++
Image

3.创建快捷方式

Image

然后新建一个项目来测试环境是否有问题,直接新建一个cpp项目,然后点击默认的配置进行运行

#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

输出为:

Hello, World!

Reference

https://blog.csdn.net/feimeng116/article/details/105898892


原文地址:https://blog.csdn.net/qq_44940689/article/details/137688564

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!