The CXX compiler identification is unknown CMake Error at CMakeLists.txt:11 (project):

Problem: when compiling GLOG 0.50, you should set the cross compiler. After setting the compiler, you will always report title errors. Enter the cross compiler on the Linux command line, but you can recognize the cross compiler;

The files for cross compiling are as follows:

the cross compiler can be recognized on the command line:

ubuntu0compile:~/glog-master/_build$ arm-linux-gnueabihf-g
arm-linux-gnueabihf-g++        arm-linux-gnueabihf-gcc-ar      arm-linux-gnueabihf-gcov        arm-linux-gnueabihf-gprof
arm-linux-gnueabihf-gcc         arm-linux-gnueabihf-gcc-nm      arm-linux-gnueabihf-gdb         
arm-linux-gnueabihf-gcc-4.9.4   arm-linux-gnueabihf-gcc-ranlib  arm-linux-gnueabihf-gfortran   

However, the following errors are reported during compilation:

ubuntu0compile:~/glog-master$ sudo cmake -H. -B_build -DCMAKE_TOOLCHAIN_FILE="${PWD}/toolchains/gcc-cxx11-crosscompiling.cmake" && cd -
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:11 (project):
  The CMAKE_CXX_COMPILER:

    arm-linux-gnueabihf-g++

  is not a full path and was not found in the PATH.

  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.


-- Configuring incomplete, errors occurred!
See also "/home/glog-master/_build/CMakeFiles/CMakeOutput.log".
See also "/home/glog-master/_build/CMakeFiles/CMakeError.log".

The fundamental reason is that the cross compiler cannot be found. Under the path, only the directory of the cross compiler is set, either reset the environment variable, or set the path of the cross compiler to an absolute path; The problem is solved by setting the absolute path

Read More: