How to fix fatal error: tclap/CmdLine.h: No such file or directory
Problem
When trying to build a C++ project that depends on TCLAP, you might encounter the following error:
example.txt
/home/uli/MyProject/device/device_cli.cpp:13:10: fatal error: tclap/CmdLine.h: No such file or directory
13 | #include <tclap/CmdLine.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/MyCLI.dir/build.make:79: CMakeFiles/MyCLI.dir/device/device_cli.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:349: CMakeFiles/MyCLI.dir/all] Error 2
## Solution
You need to install `libtclap-dev` to get the necessary header files for TCLAP. You can do this using the following command:
```bash {filename="install-tclap-dev.sh"}
sudo apt -y install libtclap-devCheck out similar posts by category:
C/C++
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow