mqcmd196 / dotfiles

My unix settings.
GNU General Public License v3.0
2 stars 0 forks source link

clangd problems #23

Closed mqcmd196 closed 1 year ago

mqcmd196 commented 1 year ago

clangd causes some problems because of a library-linking error. It should be built from source.

In ~/.local/src

git clone https://github.com/llvm/llvm-project -b llvmorg-11.1.0 --depth 1 # just for bionic
cd llvm-project
mkdir build
cd build
cmake -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_INSTALL_PREFIX=$HOME/.local/ -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm
make -j16 install
mqcmd196 commented 1 year ago

should set https://stackoverflow.com/a/74870580/19631594 ??

mqcmd196 commented 1 year ago

This article is incorrect, but should fix clangd's libstdc++ path

mqcmd196 commented 1 year ago

clang11 see /usr/include/c++/11 by default.

Option1: sudo apt install libstdc++-11-dev/bionic Option2: somehow fix clangd's default include directory (best)

mqcmd196 commented 1 year ago

https://clangd.llvm.org/guides/system-headers#query-driver

mqcmd196 commented 1 year ago

https://github.com/clangd/clangd/issues/1391#issuecomment-1326041816 works fine