【问题标题】:Error setting up catkin workspace设置 catkin 工作区时出错
【发布时间】:2016-05-24 16:54:28
【问题描述】:

我正在学习这些教程:

在 catkin_make 步骤中出现错误:

-- The C compiler identification is unknown
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:186 (configure_file):
configure_file Problem configuring file

-- The CXX compiler identification is unknown
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:185 (configure_file):
configure_file Problem configuring file

-- Check for working C compiler: /usr/bin/cc
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:47 (try_compile):
Unknown extension ".c" for file

/home/manoj/catkin_ws/build/CMakeFiles/CMakeTmp/testCCompiler.c

try_compile() works only for enabled languages.  Currently these are:

C CXX

See project() command to enable other languages.

-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/cc" is not able to compile a simple test program.

It fails with the following output:

我尝试将环境变量 CC 和 CXX 设置为 /usr/bin/gcc 和 /usr/bin/g++,但没有用。

还尝试了全新安装的cmake,仍然没有用。我在适用于 Linux 的 Windows 子系统上使用 Ubuntu。

帮助!提前致谢。

【问题讨论】:

标签: cmake ros catkin


【解决方案1】:

尝试将以下行添加到您的 CMakeLists.txt before the catkin_package()

set(CMAKE_C_COMPILER "/usr/bin/gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/g++")

有时,最好清理您的构建(通常通过删除 catkin_ws 中的 /devel 和 /build 文件夹)并重新创建 catkin_make

作为记录,不推荐这种方法(见here,方法3),但它可能会有所帮助!

【讨论】:

    【解决方案2】:

    错误在于 WSL 上的 cmake。修复是入站的。报告、讨论和复制在这里:Bash on Windows: Bugs

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-19
      • 1970-01-01
      相关资源
      最近更新 更多