c_cpp_properrties.json
这个文件,的正确与否,关系到, .cpp 文件编写过程中,代码的识别.
真正有用的就一行
{
"configurations": [
{
"name": "MGw64",
"compilerPath": "E:/MGw64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/ld.exe"
}
],
"version": 4
}
F6 默认运行.就 ok 了.
所以,最有用的几行就是包含 include 中的 .h 文件
和 lib 中的 .o 文件
“compilerPath”: “E:\MGw64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\”, 这一行
“intelliSenseMode”: “clang-x64”,
“compilerPath”: “E:\MGw64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\”,
“includePath”: [
中的是自定义包含的路径. (用法需要灵活掌握),这里尽量将问题简单化解释.
launch.json
其实这个文件是配置调试 的
“preLaunchTask”: “g++.exe build active file” 是编译完成后, 执行在 tasks.json 后
tasks.json 文件 “label”: “g++.exe build active file”, 与之对应,
★ 注意, g++ 是编译 .cpp文件的.
其实核心文件还是 tasks.json 文件,
“args”: [
“-g”,
“ f i l e " , " − o " , " {file}", "-o", " file","−o","{fileDirname}\${fileBasenameNoExtension}.exe”
执行参数就是伸长,同名 .cpp的执行文件
至于 settings.json 文件是为了配置编辑器 ,显示字体
和编码习惯.
有个问题要注意,当你的控制太运行程序不能输出,输出窗口出现乱码的时候,你需要设置区域 语言
.