iovisor / iovisor/bcc

#include errors detected. Please update your includePath for #include <uapi/linux/ptrace.h>

Open
#4,590 4 comments 4 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

While developing eBPF code in C, Visual Studio Code cannot detect some header files. For example, in tcpconnect.c, the vscode editor shows some include path errors.

```cpp
#include
#include
#include
```

I get "#include errors detected. Please update your includePath."

How would I properly update my `.vscode/c_cpp_properties/` includePath to incorporate the correct headers?

I have tried
```json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
"/usr/src/linux-headers-5.15.0-69-generic/include"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64",
}
],
"version": 4
}
```

This solves the first header "" but I still get errors for the next two.

```c
#include // cannot open source file "asm/bug.h" (dependency of "net/sock.h")C/C++(1696)
#include // cannot open source file "bcc/proto.h"C/C++(1696)
```

How do I properly configure my vscode settings to help make developing eBPF code / C code easier?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with tcpconnect.c and the .vscode/c_cpp_properties/ configuration shown in the report. Check how the includePath handles uapi/linux/ptrace.h, net/sock.h, asm/bug.h, and bcc/proto.h, then verify the configuration against the repository's header layout and the reported Linux headers. Done means the listed includes no longer produce VS Code diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, vscode
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.