DEV Community

Sean Atukorala
Sean Atukorala

Posted on


[Solved] No CMAKE CXX COMPILER could be found


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.

Enter fullscreen mode Exit fullscreen mode


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
Enter fullscreen mode Exit fullscreen mode

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


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.

Top comments (0)