免费注册自己的网站,网站关键词优化代码,自己做彩票网站,网站建设请示报告Visual Studio Code配置c/c环境 1.创建项目目录2.vscode打开项目目录3.项目中添加文件4.文件内容5.配置编译器6.配置构建任务7.配置调试设置 1.创建项目目录
d:\mkdir d:\c语言项目\test012.vscode打开项目目录 3.项目中添加文件 4.文件内容
#include iostream
u… Visual Studio Code配置c/c环境 1.创建项目目录2.vscode打开项目目录3.项目中添加文件4.文件内容5.配置编译器6.配置构建任务7.配置调试设置 1.创建项目目录
d:\mkdir d:\c语言项目\test012.vscode打开项目目录 3.项目中添加文件 4.文件内容
#include iostream
using namespace std;int main(){cout hello world endl;return 0;
}5.配置编译器 快捷键CtrlShiftP -- 输入c -- 选中C/C:Edit Configurations (UI) 修改配置 c_cpp_properties.json // c_cpp_properties.json
{configurations: [{name: windows-gcc-x64,includePath: [${workspaceFolder}/**],compilerPath: C:/tools/mingw64/bin/gcc.exe,cStandard: ${default},cppStandard: ${default},intelliSenseMode: windows-gcc-x64,compilerArgs: []}],version: 4
}6.配置构建任务 快捷键CtrlShiftP -- 输入Task -- 选中Tasks: Configure Default Build Task -- 选中C/C: g.exe 生成活动文件 // task.json 文件内容展示
{version: 2.0.0,tasks: [{type: cppbuild,label: C/C: g.exe 生成活动文件,command: C:\\tools\\mingw64\\bin\\g.exe,args: [-fdiagnostics-coloralways,-g,${file},-o,${fileDirname}\\${fileBasenameNoExtension}.exe],options: {cwd: ${fileDirname}},problemMatcher: [$gcc],group: {kind: build,isDefault: true},detail: 编译器: C:\\tools\\mingw64\\bin\\g.exe}]
}7.配置调试设置 修改调试配置文件 launch.json program: ${fileDirname}\\${fileBasenameNoExtension}.exe,调试测试 工具栏 “Run” -- “Start Debugging” // launch.json
{version: 0.2.0,configurations: [{name: C/C Runner: Debug Session,type: cppdbg,request: launch,args: [],stopAtEntry: false,externalConsole: true,cwd: d:/c语言项目/test01,program: ${fileDirname}\\${fileBasenameNoExtension}.exe,MIMode: gdb,miDebuggerPath: gdb,setupCommands: [{description: Enable pretty-printing for gdb,text: -enable-pretty-printing,ignoreFailures: true}]}]
}