Troubles with IntelliSense in MacVim and Coc

48 views Asked by At

I'm trying to setup Vim as a C++ IDE on Mac. I followed this tutorial. So I'm using Coc and coc-clangd extension. Everything works perfect, except 2 things :

  • when I try to use c++ standard libs (stdio.h works for exemple but not iostream). It says it doesn't found the header file.
  • when I try to include custom header files stored in the "include" folder of my project. It says the same.

What I have tried : (.clangd file)

CompileFlags:
  Add: [-I/absolute-path-to-include-folder]
  Compiler: clang++

This solved the second problem, even if I would prefer relative path (relative path didn't seem to work). But changing compiler from clang to clang++ didn't solve the first one. I would like to try with compile_flags.txt or compile_command.json but I don't find enough documentation. Besides I build my project with Makefile and not CMake.

Any idea?

0

There are 0 answers