欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

VScode运行ORBSLAM3

程序员文章站 2024-01-04 12:40:04
...

1. 创建c_cpp_properties.json文件

ctrl + shift + P打开vscode控制台(记住此快捷键,以后经常用),输入C/Cpp: Edit configurations,就自动生成了一个c_cpp_properties.json文件,这样你就可以在该文件中编写参数来调整设置

我的c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/usr/include/eigen3"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "gnu11",
            "cppStandard": "c++17",
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}

2. 创建tasks.json

ctrl + shift + P打开vscode控制台,输入Tasks: Configure Tasks,再选择Create tasks.json file from templates,选择Others模板,就自动生成了一个tasks.json文件,这样你就可以在该文件中编写参数来调整设置。
我的tasks.json

{
    "tasks": [
        {
            "type": "shell",
            "label": "stereo_test",
            "command": "./build.sh",
            "group": {
                "kind": "build",
                "isDefault": true
            },
        }
        
    ],
    "version": "2.0.0"
}
# 3. 创建 lunsh.json
vscode自带调试模块,直接点击左侧边栏的Debug图标(`Ctrl+Shirft+D`),再点上方的齿轮图标configure,就能自动生成launch.json文件

```cpp
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "g++ build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "/home/jinln/jinln/c++test/MF-SLAM/Examples/Stereo/stereo_test",
            "args": [
                "/home/jinln/jinln/QTproject/ORB_SLAM3/Vocabulary/ORBvoc.txt",
                "/home/jinln/Desktop/MF-ORB_SLAM3/Examples/Stereo/KITTI03.yaml",
                "/home/jinln/jinln/DATASET/kitti/03",
            ],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "stereo_test",
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ]
}
相关标签: Program linux

上一篇:

下一篇: