江苏电信网站备案,网站设计文献,互联网装修公司品牌,王磊网络网站建设概述#xff1a;tasks.jason launch.json settings.json一定要有#xff0c;没有就别想跑。还有就是c 和c配置有区别#xff0c;切记#xff0c;下文有说
1.安装扩展插件。 2.安装编译器#xff0c;gcc.我用的是x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z #xf…概述tasks.jason launch.json settings.json一定要有没有就别想跑。还有就是c 和c配置有区别切记下文有说
1.安装扩展插件。 2.安装编译器gcc.我用的是x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z 直接解压缩到你喜欢的目录然后在环境变量里面添加即可。 3.找个目录创建一个c或者c文件。
4.将目录打开可以选择在c/c文件目录下右键vscode打开即可。然后可以在目录下看到.vscode文件夹下面就是一些脚本可以改。
5.c和c不太一样。在tasks.json 里面如果没有自己创建一共三个文件在第7点里面。 6.碰到的问题点。如果细致一点按下操作如果不想麻烦直接在第7点文章末尾三个文件直接创建和我一样的就行了。 然后拷贝我的tasks目录进去就好了。 7.我的三个目录的代码是
tasks.json
{version: 2.0.0,tasks: [{type: shell,label: compile,command: gcc,args: [-g,${file},-o,${fileDirname}\\${fileBasenameNoExtension}.exe],problemMatcher: [$gcc],group: {kind: build,isDefault: true}}]
}
settings.json
{C_Cpp_Runner.cCompilerPath: gcc,C_Cpp_Runner.cppCompilerPath: g,C_Cpp_Runner.debuggerPath: gdb,C_Cpp_Runner.cStandard: ,C_Cpp_Runner.cppStandard: ,C_Cpp_Runner.msvcBatchPath: ,C_Cpp_Runner.useMsvc: false,C_Cpp_Runner.warnings: [-Wall,-Wextra,-Wpedantic,-Wshadow,-Wformat2,-Wcast-align,-Wconversion,-Wsign-conversion,-Wnull-dereference],C_Cpp_Runner.msvcWarnings: [/W4,/permissive-,/w14242,/w14287,/w14296,/w14311,/w14826,/w44062,/w44242,/w14905,/w14906,/w14263,/w44265,/w14928],C_Cpp_Runner.enableWarnings: true,C_Cpp_Runner.warningsAsError: false,C_Cpp_Runner.compilerArgs: [],C_Cpp_Runner.linkerArgs: [],C_Cpp_Runner.includePaths: [],C_Cpp_Runner.includeSearch: [*,**/*],C_Cpp_Runner.excludeSearch: [**/build,**/build/**,**/.*,**/.*/**,**/.vscode,**/.vscode/**],C_Cpp_Runner.useAddressSanitizer: false,C_Cpp_Runner.useUndefinedSanitizer: false,C_Cpp_Runner.useLeakSanitizer: false,C_Cpp_Runner.showCompilationTime: false,C_Cpp_Runner.useLinkTimeOptimization: false,C_Cpp_Runner.msvcSecureNoWarnings: false
}
launch.json
{version: 0.2.0,configurations: [{name: C/C,type: cppdbg,request: launch,program: ${fileDirname}/${fileBasenameNoExtension}.exe,args: [],stopAtEntry: false,cwd: ${workspaceFolder},environment: [],externalConsole: false,MIMode: gdb,miDebuggerPath: gdb.exe,preLaunchTask: compile,setupCommands: [{description: Enable pretty-printing for gdb,text: -enable-pretty-printing,ignoreFailures: true}]},{name: C/C Runner: Debug Session,type: cppdbg,request: launch,args: [],stopAtEntry: false,externalConsole: true,cwd: d:/test,program: d:/test/build/Debug/outDebug,MIMode: gdb,miDebuggerPath: gdb,setupCommands: [{description: Enable pretty-printing for gdb,text: -enable-pretty-printing,ignoreFailures: true}]}]
} 8. 参数解释