coc-clangd has issues with gtkmm-4.0

Viewed 188

I have the hello world program from the gtkmm documentation. I can compile the program without any issues using:

g++ -o example main.cc example.cc `pkg-config "gtkmm-4.0" --cflags --libs`

But the moment I go into neovim, coc-clangd has an error:

In included file: no template named 'is_base_of_v' in namespace 'std'; did you mean 'is_base_of'?

this happens at #include "gtkmm/application.h"

:CocInfo

vim version: NVIM v0.5.0
node version: v14.15.5
coc.nvim version: 0.0.80-37132cfc36
coc.nvim directory: /home/blah/.config/nvim/plugged/coc.nvim
term: tmux
platform: linux

clangd is 12.0.0

PS: I do have a compile_commands.json file, generated using intercept-build utility

1 Answers

I don't know if you have solved it now, I encountered the same problem as you. I thought it was a problem with clangd, but I checked the is_base_of_v and found that it only existed after C++17. If you use cmake to generate your project, just add:

set_property(TARGET ${target_name} PROPERTY CXX_STANDARD 17)

to your CMakeLists.txt to set the C++ standard to C++17.

Related