我从gtk项目的网站复制了hello world代码,并将其粘贴到环境中的vim中,以便在使用coc-clangd正确配置的C中进行开发。但是,在
#include <gtk / gtk.h>
但是当我使用命令发送编译时:
gcc `pkg-config --cflags gtk+-3.0` -o hello-world-gtk hello-world-gtk.c `pkg-config --libs gtk+-3.0`
它完美地工作,我试图添加
`pkg-config --cflags gtk+-3.0`
在
clangd.fallbackFlags
在:CocConfig中,但是没有用。
https://clangd.llvm.org/troubleshooting.html
https://sarcasm.github.io/notes/dev/compilation-database.html
clang -MJ hello-world-gtk.o.json `pkg-config --cflags gtk+-3.0` -o hello-world-gtk hello-world-gtk.c `pkg-config --libs gtk+-3.0`
sed -e '1s/^/[\n/' -e '$s/,$/\n]/' *.o.json > compile_commands.json
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句