• vscode_c++_slambook 编译配置


    工作目录

    在这里插入图片描述

    配置文件

    在这里插入图片描述

    launch.json

    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "slamBook程序调试",
                "type": "cppdbg",
                "request": "launch",
                "program": "${fileDirname}/build/${fileBasenameNoExtension}",
                "args": [],
                "stopAtEntry": true,
                "cwd": "${fileDirname}/build/",
                "environment": [],
                "externalConsole": false,
                "MIMode": "gdb",
                "setupCommands": [
                    {
                        "description": "Enable pretty-printing for gdb",
                        "text": "-enable-pretty-printing",
                        "ignoreFailures": true
                    }
                ],
                "miDebuggerPath": "/usr/bin/gdb"
            },
            {
                "name": "c++编译&调试",
                "type": "cppdbg",
                "request": "launch",
                "program": "${workspaceFolder}/exe/${fileBasenameNoExtension}",
                "args": [],
                "stopAtEntry": true,
                "cwd": "${workspaceFolder}/exe/",
                "environment": [],
                "externalConsole": false,
                "MIMode": "gdb",
                "setupCommands": [
                    {
                        "description": "Enable pretty-printing for gdb",
                        "text": "-enable-pretty-printing",
                        "ignoreFailures": true
                    }
                ],
                "miDebuggerPath": "/usr/bin/gdb",
                "preLaunchTask": "c++单文件编译"
            }
        ]
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46

    tasks.json

    {
        "version": "2.0.0",
        "tasks": [
            {
                "type": "shell",
                "label": "编译slambook的文件",
                "command": "sh -x /home/lsy/coding/slambook2/.vscode/build_slambookFile.sh",
                "options": {
                    "cwd": "${fileDirname}"
                },
                "problemMatcher": [
                    "$gcc"
                ]
            },
            {
                "type": "shell",
                "label": "c++单文件编译",
                "command": "sh -x ${workspaceFolder}/.vscode/buildSingleFile.sh ${file} ${workspaceFolder}/exe/${fileBasenameNoExtension}",
                "options": {
                    "cwd": "${fileDirname}"
                },
                "problemMatcher": [
                    "$gcc"
                ]
            }
        ]
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27

    build_slambookFile.sh

    pwd
    mkdir build
    cd build
    cmake ..
    make
    
    • 1
    • 2
    • 3
    • 4
    • 5

    buildSingleFile.sh

    fileName=$1
    outName=$2
    echo "${fileName} --> ${outName}"
    
    g++ ${fileName} -o ${outName} -g \
    -I /usr/include/eigen3
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    c_cpp_properties.json

    {
        "configurations": [
            {
                "name": "Linux",
                "includePath": [
                    "${workspaceFolder}/**",
                    "/usr/include/eigen3"
                ],
                "defines": [],
                "cStandard": "gnu11",
                "cppStandard": "gnu++14",
                "intelliSenseMode": "linux-gcc-x64"
            }
        ],
        "version": 4
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    settings.json

    {
        "python.pythonPath": "/home/lsy/anaconda3/bin/python",
        "files.associations": {
            "iostream": "cpp",
            "ostream": "cpp"
        }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
  • 相关阅读:
    [Java·基础] jdk8的优点
    信息科技风险管理
    Git操作指南:子模块、用户名修改和Subtree
    fiddler使用教程
    mulesoft Module 8 quiz 解析
    挂件板死机刷固件
    redhat配置yum源
    专用神经网络处理器芯片,嵌入式神经网络处理器
    2022年大家都说智慧工地好,那么智慧工地有哪些令人惊艳的应用价值?
    unity shader 常见的混合类型
  • 原文地址:https://blog.csdn.net/qq_28038207/article/details/126455302