Problem Statement:
I have a library installed in a custom location, and compilation and linkage works properly, but clangd is reporting various errors related to the custom lib.
My Makefile has the following flags:
CFLAGS += -I/usr/local/share/mylib
LDFLAGS += -lmylib -L/usr/local/lib/
...
<snip>
However, clangd doesn't know how to find the header file and therefore my editor is showing errors like the following where it is unhelpful:
#include <mylibheader.h> 'mylibheader.h' file not found
mylib_type1_t foo unknown type name 'mylib_type1_t'
...
<snip>
searching the internet for the errors and keywords clangd
, clangd config
, clangd .clang-format
failed to produce anything useful on SO or elsewhere (hence this question).
The question is:
How do I tell clangd where my non-standard headers are so that it won't show bogus "file not found" warnings?