Vscode + Cygwin + boost 配置文件


 

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C++ Launch (GDB)",                 // 配置名稱,將會在啟動配置的下拉菜單中顯示
            "type": "cppdbg",                           // 配置類型,這里只能為cppdbg
            "request": "launch",                        // 請求配置類型,可以為launch(啟動)或attach(附加)
            "launchOptionType": "Local",                // 調試器啟動類型,這里只能為Local
            "targetArchitecture": "x64",                // 生成目標架構,一般為x86或x64,可以為x86, arm, arm64, mips, x64, amd64, x86_64
            "program": "${file}.exe",                   // 將要進行調試的程序的路徑
            "miDebuggerPath":"D:/cygwin/bin/gdb.exe", // miDebugger的路徑,注意這里要與cygwin/MinGw的路徑對應
            "args": ["blackkitty",  "1221", "# #"],     // 程序調試時傳遞給程序的命令行參數,一般設為空即可
            "stopAtEntry": false,                       // 設為true時程序將暫停在程序入口處,一般設置為false
            "cwd": "${workspaceRoot}",                  // 調試程序時的工作目錄,一般為${workspaceRoot}即代碼所在目錄
            "externalConsole": true,                    // 調試時是否顯示控制台窗口,一般設置為true顯示控制台
            "preLaunchTask": "g++"                    // 調試會話開始前執行的任務,一般為編譯程序,c++為g++, c為gcc
        }
    ]
}
View Code

settings.json

{
    "files.associations": {
        "iostream": "cpp",
        "cmath": "cpp",
        "ostream": "cpp",
        "vector": "cpp",
        "array": "cpp",
        "deque": "cpp",
        "unordered_map": "cpp",
        "initializer_list": "cpp",
        "string_view": "cpp",
        "iosfwd": "cpp",
        "algorithm": "cpp",
        "future": "cpp",
        "atomic": "cpp",
        "*.tcc": "cpp",
        "cctype": "cpp",
        "chrono": "cpp",
        "clocale": "cpp",
        "condition_variable": "cpp",
        "cstdint": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "ctime": "cpp",
        "cwchar": "cpp",
        "cwctype": "cpp",
        "exception": "cpp",
        "fstream": "cpp",
        "functional": "cpp",
        "istream": "cpp",
        "limits": "cpp",
        "memory": "cpp",
        "mutex": "cpp",
        "new": "cpp",
        "optional": "cpp",
        "ratio": "cpp",
        "sstream": "cpp",
        "stdexcept": "cpp",
        "streambuf": "cpp",
        "system_error": "cpp",
        "thread": "cpp",
        "type_traits": "cpp",
        "tuple": "cpp",
        "typeinfo": "cpp",
        "utility": "cpp",
        "numeric": "cpp",
        "list": "cpp",
        "climits": "cpp"
    }
}
View Code

 

tasks.json

{
    "version": "0.1.0",
    "command": "g++",//對應"preLaunchTask"c++為g++, c為gcc
    "args": ["-g","${file}", "--std=c++14", "-o","${file}.exe","-lboost_system", "-lboost_date_time"],    // 編譯命令參數
    "problemMatcher": {
        "owner": "cpp",
        "fileLocation": ["relative", "${workspaceRoot}"],
        "pattern": {
            "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
            "file": 1,
            "line": 2,
            "column": 3,
            "severity": 4,
            "message": 5
        }
    }
}
View Code

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM