Neovim: external C++ Library Header file parsing not working

I am using neovim (lunarvim ide layer), I want to work with ‘openFrameworks’ library. To not get linter warning on header file includes (look at example below), I am adding all possible header files to my $CPLUS_INCLUDE_PATH and $LIBRARY_PATH (code shown below).

Is there a better way I can achieve my LSP knowing the header file contents? vs-Code somehow achieves all that.

I want to achieve this in neovim. In this temporary fix, whenever a new header is not in path, I have to find it in the library folder and add to my ~/.bashrc, so I am struggling.

Please help.

The warnings:

The annoying temporary fix, is there anything better that I can do?

# ~/.bashrc

# openFrameworks


for dir in "${include_dirs[@]}"; do

export LIBRARY_PATH="$include_path:$LIBRARY_PATH"

I had tried bear, but I am getting the following error:

RPC[Error] code_name = UnknownErrorCode, message = "Failed to parse includes"

Edit1: Also, although the linter errors on header includes have gone away, the LSP features like autocompletion etc, are not working. How do I let my editor (neovim - lunarvim) know about those header files, or should I give and switch to an IDE?

Edit2: related: (not fixed) Lsp RPC error codes printed at neovim exit (starting from 0.8.0 ?)

Solved it by installing llvm from brew,

Pay attention to the caveats:
add the following in bashrc or similar:

export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"

and then adding this in lvim config:

local nvim_lsp = require("lspconfig")

nvim_lsp.clangd.setup {
    cmd = { "/opt/homebrew/opt/llvm/bin/clangd", "--background-index" },
    root_dir = nvim_lsp.util.root_pattern("compile_commands.json", ".clangd"),