1

I'm trying to include a custom file into my program in C, and it compiles ok. However, VsCodium keeps complaining about "Squiggles" and "includePath" (don't know what that means), actually, I don't know precisely how to configure the ".vscode/c_cpp_properties.json" file as I am using WSL to compile the code and VsCodium is installed on Windows.

Here is the line:

#include "./types.h"
// #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (\\wsl$\Arch\home\{*}\{*}\{*}.c).C/C++(1696)
// cannot open source file "./types.h"

What should I do? It's a little annoying although it's working

1 Answers1

0

Go to File->Preferences->Settings.

Optional: Switch to the Workspace tab (if you only want this to take effect on the current workspace).

In the search box, type in c_cpp include path or something similar.

Find the C_Cpp->Default: Include path field, then click Add item.

Enter your include path which contains the file you want to include.

bg117
  • 354
  • 4
  • 13
  • Note that being on WSL and VSCodium doesn't matter. This process is the same for all platforms and builds of VS Code. – bg117 Jun 19 '22 at 12:27
  • The problem is, how should I specify my WSL folder/file path, I tried "types.h", "${workspaceFolder}/types.h", "\\wsl$\Arch\home\username\folder\types.h", "\\wsl$\Arch\home\username\folder\". I also have a c_cpp_properties.json file which contains "${workspaceFolder}/**" in the `includePath` property; and none of them worked... – Wemerson Jesus Jun 19 '22 at 17:30
  • `${workspaceFolder}/include-folder` should work. – bg117 Jun 20 '22 at 10:56
  • Do you mean to change 'include-folder' to the folder name? No, it didn't work at all. I decided to disable these warnings for now `"C_Cpp.errorSquiggles": "Disabled"` – Wemerson Jesus Jun 20 '22 at 21:00
  • Yes, the `include-folder` is the folder which contains the header. – bg117 Jun 23 '22 at 04:22