Visual studio code 包括在Visual Studio WebAssembly代码中检测到的错误
我正在使用WebVisualStudio代码进行WebAssembly编程。我不熟悉C/C++和WebAssembly。我安装了VSCode C/C++插件,在我的第一个hello world应用程序中,我得到了以下警告 警告:Visual studio code 包括在Visual Studio WebAssembly代码中检测到的错误,visual-studio-code,webassembly,Visual Studio Code,Webassembly,我正在使用WebVisualStudio代码进行WebAssembly编程。我不熟悉C/C++和WebAssembly。我安装了VSCode C/C++插件,在我的第一个hello world应用程序中,我得到了以下警告 警告: 通过使用C/C++包含配置C/C++插件的includePath找到了许多解决方案,但由于它是WebAssembly,使用GCC包含的路径配置是否仍然有效?您不想添加系统包含路径。相反,您希望在emscripten树中添加include路径 从tools/shared.
通过使用C/C++包含配置C/C++插件的includePath找到了许多解决方案,但由于它是WebAssembly,使用GCC包含的路径配置是否仍然有效?您不想添加系统包含路径。相反,您希望在emscripten树中添加include路径 从tools/shared.py的第1042行可以看出:
c_include_paths = [
path_from_root('system', 'include', 'compat'),
path_from_root('system', 'include'),
path_from_root('system', 'include', 'SSE'),
path_from_root('system', 'include', 'libc'),
path_from_root('system', 'lib', 'libc', 'musl', 'arch', 'emscripten'),
path_from_root('system', 'local', 'include')
]
cxx_include_paths = [
path_from_root('system', 'include', 'libcxx'),
path_from_root('system', 'lib', 'libcxxabi', 'include')
]
1首先,从这个位置安装MinGW
2从installation manager中,标记*g++和gcc*进行安装
3安装完成后,进入MinGW的bin文件夹,检查是否有g++和gcc文件。复制bin文件夹的路径,例如:D:/bin
4右键单击这台电脑->属性->高级系统设置->环境变量
5选择路径,然后单击编辑->新建并粘贴复制的位置bin文件夹
6现在打开VSCode,保存并运行程序以获得结果。VSCode将使用什么工具链?发布您的代码和详细的错误消息,包括从哪一行获得警告。
#include <stdio.h> // get the warning in this line
int main(int argc, char ** argv) {
printf("Hello World\n");
}
c_include_paths = [
path_from_root('system', 'include', 'compat'),
path_from_root('system', 'include'),
path_from_root('system', 'include', 'SSE'),
path_from_root('system', 'include', 'libc'),
path_from_root('system', 'lib', 'libc', 'musl', 'arch', 'emscripten'),
path_from_root('system', 'local', 'include')
]
cxx_include_paths = [
path_from_root('system', 'include', 'libcxx'),
path_from_root('system', 'lib', 'libcxxabi', 'include')
]