简体   繁体   English

Linux上的clangd找不到默认标头

[英]clangd on linux cannot find default headers

I've installed the newest LLVM toolchain from the official PPA, including clang, clang-tools-extra, lldb, lld, libc++ and libc++abi. 我已经从官方PPA安装了最新的LLVM工具链,包括clang,clang-tools-extra,lldb,lld,libc ++和libc ++ abi。 I'm trying to use clangd with emacs + lsp . 我正在尝试将clangd与emacs + lsp一起使用。

All works fine except clangd cannot find default headers like memory, vector and so on. 一切正常,除了clangd找不到内存,向量等默认标头。 My code is fine, it is normally compiled using clang. 我的代码很好,通常使用clang编译。 My compile_commands.json also okay. 我的compile_commands.json也可以。

How to make clangd work? 如何使c工作?

Edit: removed mention about building llvm+clang from sources since it has been done incorrectly. 编辑:删除了关于从源代码构建llvm + clang的提及,因为它做得不正确。

I didn't find any info on the internet, so posting the solution here. 我在互联网上找不到任何信息,因此请在此处发布解决方案。 Suppose the llvm toolchain is installed in /usr/lib/llvm-8 . 假设llvm工具链安装在/usr/lib/llvm-8 The answer is: 答案是:

sudo ln -s /usr/lib/llvm-8/include/c++/v1 /usr/include/c++/v1

That's it. 而已。 Good luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM