I'm trying to develop a Linux kernel module with vscode on Ubuntu, but vscode will throw a lot errors about Linux system header, kernel macro, etc. (Even if it's just a almost empty driver...)
Can somebody help me configure vscode to remove these errors?
Below is my configuration and the screenshots of errors.
//c_cpp_properties.json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}",
"/usr/src/linux-headers-4.15.0-65/include"
],
"defines": [
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c99",
"cppStandard": "c++14",
"browse": {
"path": [
"${workspaceFolder}",
"/usr/src/linux-headers-4.15.0-65/include"
],
"limitSymbolsToIncludedHeaders": true
},
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
//settings.json
{
"files.associations": {
"init.h": "c",
"module.h": "c",
"workqueue.h": "c",
"list.h": "c",
"types.h": "c",
"posix_types.h": "c"
},
"C_Cpp.errorSquiggles": "Enabled",
"clang.cflags": [
"-std=c99",
"-I/usr/src/linux-headers-4.15.0-65/include",
"-DMODULE",
]
}
