赞
踩
链接:https://pan.baidu.com/s/13bmi22264pP_8Cojo2FRGQ
提取码:d416
如果没有右键Open with Code,就新建一个test.reg文件,然后把下面代码复制到该文件,将vscode的路径【E:\\Program Files (x86)\\Microsoft VS Code\\Code.exe】替换为自己的安装路径,保存,双击就行
- Windows Registry Editor Version 5.00
-
- [HKEY_CLASSES_ROOT\*\shell\VSCode]
- @="Open with Code"
- "Icon"="E:\\Program Files (x86)\\Microsoft VS Code\\Code.exe"
-
- [HKEY_CLASSES_ROOT\*\shell\VSCode\command]
- @="\"E:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
-
- Windows Registry Editor Version 5.00
-
- [HKEY_CLASSES_ROOT\Directory\shell\VSCode]
- @="Open with Code"
- "Icon"="E:\\Program Files (x86)\\Microsoft VS Code\\Code.exe"
-
- [HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
- @="\"E:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%V\""
-
- Windows Registry Editor Version 5.00
-
- [HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
- @="Open with Code"
- "Icon"="E:\\Program Files (x86)\\Microsoft VS Code\\Code.exe"
-
- [HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
- @="\"E:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%V\""
- /*
- * @Author: your name
- * @Date: 2021-07-31 00:12:45
- * @LastEditTime: 2021-08-02 00:31:20
- * @LastEditors: DESKTOP-EN3DD6F
- * @Description: In User Settings Edit
- * @FilePath: \C++\HelloWorld .cpp
- */
- #include <iostream>
-
- using namespace std;
-
- int main(int argc, char** argv)
- {
- cout << "Hello World" <<endl;
- getchar();
- return 0;
- }
7.F5后选择第一项如图
弹框后继续选择第一项
会生成lanch.json和tasks.json文件
lanch.json
- {
- // 使用 IntelliSense 了解相关属性。
- // 悬停以查看现有属性的描述。
- // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
- "version": "0.2.0",
- "configurations": [
- {
- "name": "g++.exe - 生成和调试活动文件",
- "type": "cppdbg",
- "request": "launch",
- "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
- "args": [],
- "stopAtEntry": false,
- "cwd": "${fileDirname}",
- "environment": [],
- "externalConsole": false,
- "MIMode": "gdb",
- "miDebuggerPath": "E:\\tower\\MinGW\\bin\\gdb.exe",
- "setupCommands": [
- {
- "description": "为 gdb 启用整齐打印",
- "text": "-enable-pretty-printing",
- "ignoreFailures": true
- }
- ],
- "preLaunchTask": "C/C++: g++.exe 生成活动文件"
- }
- ]
- }
tasks.json
- {
- "tasks": [
- {
- "type": "cppbuild",
- "label": "C/C++: g++.exe 生成活动文件",
- "command": "E:\\tower\\MinGW\\bin\\g++.exe",
- "args": [
- "-g",
- "${file}",
- "-o",
- "${fileDirname}\\${fileBasenameNoExtension}.exe"
- ],
- "options": {
- "cwd": "${fileDirname}"
- },
- "problemMatcher": [
- "$gcc"
- ],
- "group": {
- "kind": "build",
- "isDefault": true
- },
- "detail": "调试器生成的任务。"
- }
- ],
- "version": "2.0.0"
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。