VSCode windows下的配置文件

.vscode文件夹下,配置以下三个文件:

c_cpp_properties.json   // compiler path and IntelliSense settings

tasks.json     // compiler build settings

launch.json   // debugger settings

新建工程,可直接拷贝这三个文件,根据需要修改注释部分 的配置。

 

1. c_cpp_properties.json

 

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/EigenArduino_Eigen30" //自定义、库等 头文件 所在目录
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "D:\\Mingw-w64\\mingw64\\bin\\g++.exe", //mingw64安装路径
            "cppStandard": "c++11",
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}

 

 

2.tasks.json

配置完成后Ctrl +Shift + b 进行build;

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build hand",
            "type": "shell",
            "command": "g++",
            "args": [
                "-g",

                "-I",
                "./EigenArduino_Eigen30", //**** include目录

                "-o",
                "Thumb_test", //*** build生成的可执行文件名

                //*********** 以下是相关的.cpp文件 
                "test_HandManipulatePlan.cpp",
                "HandManipulatePlan.cpp",  
               "Hand.cpp",
               "ThumbKinematicFast.cpp",
               "ThumbKinematic.cpp",
               "FingerController.cpp",
               "utils.cpp",
               "FingerModule.cpp",
                "can.cpp",

                "-L",
                "./can",//**** lib目录

                "ControlCAN.dll"//**** 动态链接库
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        }
    ]
}

 

3.launch.json

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/Thumb_test.exe", //**** 要运行的可执行文件
            "args": ["1","2"],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "D:\\Mingw-w64\\mingw64\\bin\\gdb.exe", //*** mingw64路径
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

 

### 配置 Windows 上的 VSCode Python 开发环境 #### 安装 Visual Studio Code 和 Python 为了在 Windows配置适用于 Python 开发的 Visual Studio Code (VSCode),需先安装这两个组件。确保从官方渠道获取最新版本的应用程序[^1]。 #### 下载并安装 VSCode 及 Python 访问官方网站下载适合 Windows 系统的安装包,并按照提示完成安装过程。对于 Python 来说,在安装过程中建议勾选“Add Python to PATH”,以便于后续命令行操作更加便捷[^2]。 #### 验证 Python 安装 通过命令提示符验证 Python 是否正确安装。打开 CMD 终端窗口,键入 `python` 命令启动解释器;接着尝试执行 `import this` 测试语句来确认一切正常工作。如果显示“The Zen of Python”则表明安装成功[^4]。 #### 设置 VSCode 编辑器 一旦上述准备工作就绪,接下来就是针对 Python 进行必要的编辑器设定: - **扩展插件**: 打开 VSCode 后,前往 Extensions 视图 (`Ctrl+Shift+X`) 并搜索 "Python" 插件进行安装。此插件提供了诸如 IntelliSense、Linting 支持等功能。 - **选择解释器路径**: 使用快捷方式 `Ctrl+Shift+P` 调出 Command Palette ,输入 “Python Select Interpreter”。从中挑选已安装好的 Python 版本作为默认解析器。 - **调试配置文件**: 创建 `.vscode/launch.json` 文件来自定义运行参数以及断点调试选项。一个简单的例子如下所示: ```json { "version": "0.2.0", "configurations": [ { "name": "Python: Current File", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal" } ] } ``` 至此,已经完成了基本的开发环境搭建流程,现在可以在集成终端内直接编写和测试 Python 代码了[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值