vscode 配置c++记录

  1. c_cpp_properties.json
{
	"configurations": [
		{
			"name": "MinGW",
			"includePath": ["${workspaceFolder}/**"],
			"defines": ["_DEBUG", "UNICODE", "_UNICODE"],
			"compilerPath": "C:\\mingw64\\bin\\g++.exe",
			"cStandard": "c11",
			"cppStandard": "c++17",
			"intelliSenseMode": "clang-x64"
		},
		{
			"name": "WSL",
			"intelliSenseMode": "gcc-x64",
			"compilerPath": "/usr/bin/gcc",
			"includePath": ["${workspaceFolder}/**"],
			"defines": [],
			"cStandard": "c11",
			"cppStandard": "c++17"
		}
	],
	"version": 4
}

  1. launch.json
{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "(gdb) Launch",
			"type": "cppdbg",
			"request": "launch",
			"program": "${workspaceFolder}/${fileBasenameNoExtension}.exe",
			"args": [],
			"stopAtEntry": false,
			"cwd": "${workspaceFolder}",
			"environment": [],
			"externalConsole": true,
			"MIMode": "gdb",
			"miDebuggerPath": "c:\\mingw64\\bin\\gdb.exe",
			"setupCommands": [
				{
					"description": "Enable pretty-printing for gdb",
					"text": "-enable-pretty-printing",
					"ignoreFailures": true
				}
			],
			"preLaunchTask": "build eigen"
		}
	]
}

  1. settings.json
{
	"files.associations": {
		"queue": "cpp",
		"vector": "cpp",
		"array": "cpp",
		"*.tcc": "cpp",
		"bitset": "cpp",
		"cctype": "cpp",
		"clocale": "cpp",
		"cmath": "cpp",
		"cstdint": "cpp",
		"cstdio": "cpp",
		"cstdlib": "cpp",
		"cstring": "cpp",
		"cwchar": "cpp",
		"cwctype": "cpp",
		"deque": "cpp",
		"list": "cpp",
		"unordered_map": "cpp",
		"exception": "cpp",
		"fstream": "cpp",
		"functional": "cpp",
		"initializer_list": "cpp",
		"iosfwd": "cpp",
		"iostream": "cpp",
		"istream": "cpp",
		"limits": "cpp",
		"new": "cpp",
		"ostream": "cpp",
		"numeric": "cpp",
		"sstream": "cpp",
		"stdexcept": "cpp",
		"streambuf": "cpp",
		"type_traits": "cpp",
		"tuple": "cpp",
		"typeinfo": "cpp",
		"utility": "cpp",
		"stdlib.h": "c",
		"valarray": "cpp",
		"chrono": "cpp",
		"map": "cpp",
		"atomic": "cpp",
		"cfenv": "cpp",
		"cinttypes": "cpp",
		"complex": "cpp",
		"condition_variable": "cpp",
		"csetjmp": "cpp",
		"csignal": "cpp",
		"cstdarg": "cpp",
		"ctime": "cpp",
		"forward_list": "cpp",
		"unordered_set": "cpp",
		"future": "cpp",
		"iomanip": "cpp",
		"mutex": "cpp",
		"ratio": "cpp",
		"scoped_allocator": "cpp",
		"system_error": "cpp",
		"thread": "cpp",
		"typeindex": "cpp",
		"random": "cpp",
		"regex": "cpp",
		"stack": "cpp",
		"xhash": "cpp",
		"xstring": "cpp",
		"xtree": "cpp",
		"xutility": "cpp",
		"string_view": "cpp"
	},
	"code-runner.runInTerminal": true, // 设置成false会在“输出”中输出,无法交互
	"code-runner.saveFileBeforeRun": true,
	"C_Cpp.clang_format_sortIncludes": true
}

  1. tasks.json
{
	"version": "2.0.0",
	"tasks": [
		{
			"label": "build eigen",
			"type": "shell",
			"command": "g++",
			"args": ["-g", "${file}", "-o", "${fileBasenameNoExtension}.exe"],
			"group": {
				"kind": "build",
				"isDefault": true
			}
		}
	]
}

posted @ 2019-07-23 11:08  Ruohua3kou  阅读(488)  评论(0编辑  收藏  举报