问题陈述:
我在自定义位置安装了一个库,编译和链接工作正常,但 clangd 报告了与自定义库相关的各种错误。
我的 Makefile 有以下标志:
CFLAGS += -I/usr/local/share/mylib
LDFLAGS += -lmylib -L/usr/local/lib/
...
<snip>
但是,clangd 不知道如何找到头文件,因此我的编辑器显示如下错误,但无济于事:
#include <mylibheader.h> 'mylibheader.h' file not found
mylib_type1_t foo unknown type name 'mylib_type1_t'
...
<snip>
在互联网上搜索错误和关键字clangd
,未能在 SO 或其他地方产生任何有用的东西(因此这个问题)clangd config
。clangd .clang-format
问题是:
如何告诉 clangd 我的非标准标头在哪里,这样它就不会显示虚假的“找不到文件”警告?