Cmake cannot find compiler

2019-09-04 08:20发布

问题:

I am trying to generate binaries from the source code of the gcc-xml software but when I use Cmake I have this error:

The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error in :
No CMAKE_C_COMPILER could be found.



CMake Error in :
No CMAKE_CXX_COMPILER could be found.



CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present.  A line of code such as

cmake_minimum_required(VERSION 3.2)

should be added at the top of the file.  The version specified may be     lower
if you wish to support older CMake versions for this project.  For more
information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

I don't know why I have this error

回答1:

If you use cmake-gui, at the first configuration (=start from a clean directory) you have the option to select the full path to your compiler. Now, of course, you need a compiler installed! So take care of having one.



标签: xml cmake