1

I have a problem similar to this Including header files recursively for syntastic except my directory structure is a lot more complex so I'm not sure where to place the config file.

the .cpp file I'm editing (let's name it myfile.cpp) looks like this

#include <path/to/fileA.h>
#include <path/to/another/fileB.h>
...

and my the directory structure looks something like this:

program
|-include
  |-path
    |-to
      |-fileA.h
      |-another
        |-fileB.h
|-modules
  |-module1
    |-myfile.cpp
|-src

Moreover the make command is run from a directory on the same level as program (program-out) but I guess this has nothing to do with it.

So the question is: where should I put my config file containing the -I flag? which directory should I pass as parameter? Also considering that my include directives make use of <> and not ""

//EDIT Currently my config file contains the following

-Iinclude
-I../include
-I../../include
-I../../../include

and I placed a copy in program, program/src, program/modules/module1 and also in a few folder inside program-out prepending program to include

But it still doesn't work

Bamarin
  • 11
  • 3
  • I usually to pass in the root of the include folder so that everyone has a common base and there's only one setting to mess with. – user4581301 Sep 23 '20 at 23:17
  • @user4581301 so you suggest that I only write -Iinclude in the config file and place it in every folder until it works? – Bamarin Sep 24 '20 at 06:59
  • Write a single config file, in the root of your project. Read `:h syntastic-config-format` and `:h syntastic-debug`. Better yet don't use syntastic for linting C++ projects, specialized plugins such as [YouCompleteMe](https://github.com/ycm-core/YouCompleteMe) are much better suited for that. – lcd047 Sep 24 '20 at 07:29
  • Thanks @lcd047 `:h syntastic-debug` is something I was looking for. So the path is correctly added, but the error still shows up. Btw I'm using both Syntastic and YCM, i thought YCM don't show errors. I started here https://stackoverflow.com/questions/4237817/configuring-vim-for-c – Bamarin Sep 24 '20 at 14:11

0 Answers0