由于项目借助cmake进行编译时,需要升级g++,所以就安装了新版本,一阵操作猛如虎,结果cmake直接告诉我CMake Error at CMakeLists.txt:7 : 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.要解决这个问题,首先看看系统能不能找到g++进行编译如上图,gcc可以找到,但是g++就不行了。