如何修复 fatal error:tclap/CmdLine.h: No such file or directory
问题
在尝试构建依赖 TCLAP 的 C++ 项目时,你可能会遇到以下错误:
tclap-cmdline-error.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解决方案
你需要安装 libtclap-dev 以获取 TCLAP 所需的头文件。可以使用以下命令安装:
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