c++ - CLion 编译器设置

标签 c++ compiler-errors ide clion jetbrains-ide

我刚刚开始使用 C++ 和 CLion IDE。在观看了一个展示如何开始使用 CLion 的 YouTube 视频后,我收到了这个错误。我所做的只是尝试将 GCC 添加到 CLion 作为 C++ 的编译器。没有别的。

我有 GCC 版本 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

我只在 HTML CSS 和 JS 上编程了大约 3 个月,所以这个错误超出了我的理解。任何帮助将不胜感激!

下面是我的错误和屏幕截图的链接

-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
  The CMAKE_CXX_COMPILER:

    GCC

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/home/dominic/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/home/dominic/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeError.log".

[Failed to reload]


Cmake List
Screenshot of my ERROR

最佳答案

如果您只想使用 gcc,请使用编译器的完整路径或将 gcc 路径添加到 PATH .

我猜如果你指定 C 编译器为 /usr/bin/gcc (或 /usr/local/bin/gcc 如果你安装了它)和 C++ 编译器为 /usr/bin/g++在首选项 |构建、执行、部署 |工具链一切正常。

请注意 Linux 是区分大小写的操作系统,GCC 可执行文件是 gcc .

关于c++ - CLion 编译器设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61572818/

相关文章:

user-interface - Visual Studio Code 中的事件栏宽度

c# - 是否可以在代码注释中插入图像?

c++ - 使用与 new 中使用的指针类型不同的指针删除内存是否安全?

c++ - 在由形成凸四边形的 4 个点定义的一组 6 个线段中查找对角线的算法

c++ 项目构建成功但给出 g++ 编译器错误消息

java - 不兼容的类型 : java. lang.String 无法转换为 String

c++ - 删除对 Windows SDK 版本的依赖

c++ - 为什么 boost ptr_container 在运行时不会发生双重释放或损坏错误?

makefile - 进入额外目录

ide - Notepad++ 是否显示所有隐藏字符?