http://blog.csdn.net/c_duoduo/article/details/51615381c++
cygwin設置
- cygwin安裝路徑設置到Windows的path環境變量中:
A:\cygwin\bin
使得在cmd中可使用gcc/g++命令
visual studio code 配置
- 設置.vscode下的文件
- 修改launch.json文件配置,使用如下的代碼覆蓋default
值得注意的是,」miDebuggerPath」的路徑仍是Windows類型的路徑a:/cygwin/bin/gdb.exe
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (GDB)",
"type": "cppdbg",
"request": "launch",
"launchOptionType": "Local",
"targetArchitecture": "x86",
"program": "${file}.exe",
"miDebuggerPath":"a:/cygwin/bin/gdb.exe",
"args": ["blackkitty", "1221", "# #"],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"externalConsole": true,
"preLaunchTask": "gcc"
}
]
}
{
"version": "0.1.0",
"command": "gcc",//對應"preLaunchTask"c++爲g++, c爲gcc
"args": ["-g","${file}","-o","${file}.exe"], // 編譯命令參數
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
- 這裏設置的「program」編譯出的程序名是含後綴名.c.cpp的exe程序。怎麼設置不要後綴名?