-- CMAKE_SYSTEM_NAME: ** -- The CXX compiler identification is unknown ** -- The C compiler identification is GNU 9.3.0 CMake Error at CMakeLists.txt:39 (project): No CMAKE_CXX_COMPILER could be found. 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. -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Configuring incomplete, errors occurred!
出现该错误的原因是因为cmake找不到C++的编译器(比如找不到g++)
g++ --version Command 'g++' not found, but can be installed with: sudo apt install g++ xxxx@thinkpad-e15:~/Desktop$ sudo apt install g++ Reading package lists... Done Building dependency tree Reading state information... Done g++ is already the newest version (4:9.3.0-1ubuntu2). The following packages were automatically installed and are no longer required: libllvm11 python3-catkin shim Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 63 not upgraded.
after gcc g++ all 9.3:
-- CMAKE_SYSTEM_NAME:
-- The CXX compiler identification is GNU 9.3.0
-- The C compiler identification is unknown
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:39 (project):
The CMAKE_C_COMPILER:
/usr/bin/cc
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
指定gcc、g++的路径
cmake .. -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ .. -- CMAKE_SYSTEM_NAME: -- The C compiler identification is GNU 9.3.0 -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Build type: Release -- ccache: Disabled -- Address/Memory sanitizer: DISABLED -- Stack trace logger: ENABLED -- No preference for use of exported glog CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported glog CMake configuration if available. -- Failed to find installed glog CMake configuration, searching for glog build directories exported with CMake. -- Failed to find an installed/exported CMake configuration for glog, will perform search for installed glog components. -- Found Glog: /usr/include -- Google Perftools: DISABLED -- Architecture-aware optimization (-march=native): ENABLED -- SSE3 for ORB extraction (-msse3): DISABLED -- SSE for floating-point operation (-mfpmath=sse): DISABLED -- Performing Test COMPILER_SUPPORTS_CXX17 -- Performing Test COMPILER_SUPPORTS_CXX17 - Failed -- Performing Test COMPILER_SUPPORTS_CXX14 -- Performing Test COMPILER_SUPPORTS_CXX14 - Failed -- Performing Test COMPILER_SUPPORTS_CXX11 -- Performing Test COMPILER_SUPPORTS_CXX11 - Failed -- Performing Test COMPILER_SUPPORTS_CXX0X -- Performing Test COMPILER_SUPPORTS_CXX0X - Failed CMake Error at CMakeLists.txt:196 (message): **The compiler /usr/bin/g++ has no C++11 support.** Please use a different C++ compiler.



