VS Code adding multiple repos

108 views Asked by At

I'm using clang-tidy in VS Code, and I'm connecting to a remote machine via ssh. However, I have some include files that do not share the same area as my source file:

//  Paths:
//  /source/file/path/source.C
//  /header/file/path/header.h

#include "My_Header.h" // clang-tidy marks this as file not found

I'm assuming that if I can add multiple file directories into VS Code, then clang-tidy will be able to find all headers and complete the scan. Is this correct? How would I do that?

1

There are 1 answers

0
tsvedas On

It is not found, because header files are not searched this way, refer to documentation.

#include <file>

This variant is used for system header files. It searches for a file named file in a standard list of system directories. You can prepend directories to this list with the -I option (see Invocation).

#include "file"

This variant is used for header files of your own program. It searches for a file named file first in the directory containing the current file, then in the quote directories and then the same directories used for <file>. You can prepend directories to the list of quote directories with the -iquote option.

To solve this, make path relative. Depending on your hierarchy, it might contain many ../../ in the path...