How to fix CMake Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES)

Problem

When building your project using cmake ., you see the following warning or error message:

example.txt
-- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES)

Solution

This error indicates that CMake is unable to find the LibEdit library, which is a common library for command-line editing and history.

To resolve this issue, install it using

install_libedit.sh
sudo apt install libedit-dev

Then, re-run cmake . and the error should be resolved.


Check out similar posts by category: CMake, C/C++