I'm trying to develop a C program in webassembly, and need to include the emscripten header files for that purpose.
The following C code:
#include <stdio.h>
#include <emscripten/emscripten.h>
...
Results in the following error:
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/christianskovholm/Documents/Source/wasm_3/hello3.c).
In my c_cpp_properties.json for the project of the above C code, i have the following configuration. As you can see, I have added the directory where emscripten/emscripten.h
lives. So why am I getting the include error?
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64"
},
{
"name": "default",
"includePath": [
"${workspaceFolder}/**",
"/home/christianskovholm/Documents/Source/emsdk/upstream/emscripten/system/include/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
question from:
https://stackoverflow.com/questions/65914927/how-to-properly-add-an-includepath-in-c-cpp-properties-json-in-vscode 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…