<p>Double quotes means that the compiler will search for the include relative to the source file. Angle brackets means the compiler will search only the include paths. By using angle brackets and including all of the header files in the include path, the paths given in the include will always need to be relative to the project's source root.</p>
<p>The purpose of doing this is to reduce developer confusion as there are several files in different directories that are named the same. Requiring the include path to be relative to the source root, it becomes unambiguous as to which file is being included.</p>
<p>The PR that implemented this was (a rebase of) <a href="https://github.com/bitcoin/bitcoin/pull/11053" rel="noreferrer">https://github.com/bitcoin/bitcoin/pull/11053</a>, and that links to other discussions for motivation.</p>

CC BY-SA 4.0
2022-08-28T15:02:15.727Z
Is there a CLANG flag to avoid this message in Vim? `'bech32.h' file not found with <angled> include; use "quotes" instead"
Bitcoin_1o1
CC BY-SA 4.0
2022-08-28T18:03:43.840Z
You need to make sure the project's src/ directory is in the include paths. For clang, if running in src/, that'd just be `-I.`.
Pieter Wuille
CC BY-SA 4.0
2022-08-28T04:40:53.700Z
2022-08-28T04:40:53.700Z
Ava Chow
<p>Why Bitcoin Core source code use <code>#include &lt;rpc/wallet.h&gt;</code> bracket syntax instead of <code>#include &quot;rpc/wallet.h&quot;</code> quote syntax. Can intellisense C++ editors understand this option and not show a warning?</p>

<bitcoin-core-development><c++><source-code>
Why Bitcoin Core source code use #include bracket syntax instead of quote syntax
Bitcoin_1o1
# Why Bitcoin Core source code use #include bracket syntax instead of quote syntax

(Asked by: username_0 on 2022-08-27)

Why Bitcoin Core source code use `#include <rpc/wallet.h>` bracket syntax instead of `#include "rpc/wallet.h"` quote syntax. Can intellisense C++ editors understand this option and not show a warning?

**Tags:** bitcoin-core-development, c++, source-code


---

## 1 answers

### Answer by username_1 on 2022-08-28. Score: 7

Double quotes means that the compiler will search for the include relative to the source file. Angle brackets means the compiler will search only the include paths. By using angle brackets and including all of the header files in the include path, the paths given in the include will always need to be relative to the project's source root.

The purpose of doing this is to reduce developer confusion as there are several files in different directories that are named the same. Requiring the include path to be relative to the source root, it becomes unambiguous as to which file is being included.

The PR that implemented this was (a rebase of) <https://github.com/bitcoin/bitcoin/pull/11053>, and that links to other discussions for motivation.

> **Comments:**
> **username_0**: Is there a CLANG flag to avoid this message in Vim? `'bech32.h' file not found with <angled> include; use "quotes" instead"  
> **username_2**: You need to make sure the project's src/ directory is in the include paths. For clang, if running in src/, that'd just be `-I.`.  

---

