gpt4 book ai didi

cmake - 设置 catkin 工作区时出错

转载 作者:行者123 更新时间:2023-12-03 18:34:50 24 4
gpt4 key购买 nike

我正在学习这些教程:

在步骤 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。

帮助!提前致谢。

最佳答案

尝试在您的 CMakeLists.txt catkin_package() 之前添加以下行:

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

有时,清理您的构建(通常通过删除 catkin_ws 中的/devel 和/build 文件夹)并重新执行 catkin_make 也是更好的做法。

郑重声明,不推荐这种方法(参见 here ,方法 3),但它可能有帮助!

关于cmake - 设置 catkin 工作区时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37419634/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com