# The VSCode editor cannot find the Garfield++ header file

**URL:** <https://root-forum.cern.ch/t/the-vscode-editor-cannot-find-the-garfield-header-file/64751>\
**Category:** Garfield++\
**Created:** [March 13, 2026, 7:17am UTC](https://root-forum.cern.ch/t/the-vscode-editor-cannot-find-the-garfield-header-file/64751 "2026-03-13T07:17:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wgb520](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wgb520/32/37797_2.png) [@wgb520](https://root-forum.cern.ch/u/wgb520)\
**Post date:** [March 13, 2026, 7:17am UTC](https://root-forum.cern.ch/t/the-vscode-editor-cannot-find-the-garfield-header-file/64751/1 "2026-03-13T07:17:31Z")

</div>

ROOT Version: 6.36.08  
Built for linuxx8664gcc on Mar 10 2026, 09:46:52

cmake version 3.28.3

gcc version 13.3.0

I have successfully installed Garfield++ and VSCode, but my compiler is unable to correctly recognize the header files of Garfield, resulting in red wavy lines appearing in the compiler.

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/5/0/50bfecb7f0d4622ede17996e9d379c1f0ec76bf6.png)

Even though I updated the .vscode/c\_cpp\_properties.json configuration file and added the correct path to the Garfield++ header files, there are still red wavy lines appearing.

By the way, when I was compiling Garfield++ using CMake, I changed the installation path to /usr/local. I also installed Geant4 through source code compilation, but VSCode was able to correctly recognize the Geant4 header files.

---

<div class="post-metadata">

**Author:** ![wgb520](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wgb520/32/37797_2.png) [@wgb520](https://root-forum.cern.ch/u/wgb520)\
**Post date:** [March 13, 2026, 9:21am UTC](https://root-forum.cern.ch/t/the-vscode-editor-cannot-find-the-garfield-header-file/64751/2 "2026-03-13T09:21:56Z")

</div>

OK，I changed the file name suffix to.cc, and then VSCode was able to correctly recognize the header files. I found that the file suffix affects the language mode of IntelliSense, which leads to the inability to use syntax highlighting, code completion, and header file search rules properly. You can either modify the suffix name or modify the VSCode configuration file associated with the .cc suffix.

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [March 13, 2026, 2:16pm UTC](https://root-forum.cern.ch/t/the-vscode-editor-cannot-find-the-garfield-header-file/64751/3 "2026-03-13T14:16:42Z")

</div>

Dear @wgb520 ,

> [@wgb520](#):
>
> I found that the file suffix affects the language mode of IntelliSense

This can absolutely be the case, thanks for sharing the insight for the benefit of the community!

Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [March 13, 2026, 2:39pm UTC](https://root-forum.cern.ch/t/the-vscode-editor-cannot-find-the-garfield-header-file/64751/4 "2026-03-13T14:39:08Z")

</div>

Thanks indeed!

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 27, 2026, 2:39pm UTC](https://root-forum.cern.ch/t/the-vscode-editor-cannot-find-the-garfield-header-file/64751/5 "2026-03-27T14:39:43Z")

</div>

Closed on March 27, 2026, 2:39pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
