backward-cpp
backward-cpp copied to clipboard
CMake Error
I'm trying to build this project on a RHEL7 machine, but CMake fails with this error:
./builds.sh cmake
Creating build_c++98_gcc-4.4
CMake Error at /usr/local/share/cmake-3.20/Modules/CMakeDetermineCXXCompiler.cmake:48 (message):
Could not find compiler set in environment variable CXX:
g++-4.4.
Call Stack (most recent call first):
CMakeLists.txt:24 (project)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
I am not familiar with CMake, and have no idea why g++ 4.4 is even tried, the g++ compiler version is:
$ g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ cmake --version
cmake version 3.20.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ env | grep CXX
CXX=/usr/bin/g++
CMAKE_CXX_COMPILER=/usr/bin/g++
Work around is to explicitely add these lines to the CMakeLists.txt:
set( CMAKE_CXX_COMPILER "/usr/bin/g++" )
set( CMAKE_C_COMPILER "/usr/bin/gcc" )