Published on

[Solved]The CXX compiler identification is unknown CMake Error at CMakeLists.txt:3 (project): No CMAKE CXX COMPILER could be found

Problem:

Running into the following error when trying to run cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo:

-- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:3 (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.

Solution:

This error is usually caused by the build-essential package not being installed. If you're on Ubuntu run the following commands to install this package:

sudo apt update
sudo apt install build-essential

After installing this package, try running the cmake command again and this error should be resolved.

Conclusion

Thanks for reading this blog post!

If you have any questions or concerns please feel free to post a comment in this post and I will get back to you when I find the time.

If you found this article helpful please share it and make sure to follow me on Twitter and GitHub, connect with me on LinkedIn and subscribe to my YouTube channel.