windows vscode安装boost后undefined reference to `ontop_fcontext‘

需要在task.json中引入库,直接指定库的具体路径,比如"D:\mingw64\x86_64-w64-mingw32\lib\libboost_context-mgw54-mt-d-x64-1_72.a",

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558 
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
        "type": "shell",
        "label": "task g++",
        "command": "D:\\mingw64\\bin\\g++.exe",	/*修改成自己bin目录下的g++.exe,这里的路径和电脑里复制的文件目录有一点不一样,这里是两个反斜杠\\*/
        "args": [
            "-g",
            "${file}",
            "-o",
            "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "-I",
            "D:\\testprogram\\ConfigCenter",      /*修改成自己放c/c++项目的文件夹,这里的路径和电脑里复制的文件目录有一点不一样,这里是两个反斜杠\\*/
            "-std=c++17",
            "D:\\mingw64\\x86_64-w64-mingw32\\lib\\libboost_context-mgw54-mt-d-x64-1_72.a",/*引入boost的context库*/
            
        ],
        "options": {
            "cwd": "D:\\mingw64\\bin"	/*修改成自己bin目录,这里的路径和电脑里复制的文件目录有一点不一样,这里是两个反斜杠\\*/
        },
        "problemMatcher":[
            "$gcc"
        ],
        "group": "build",
        
        }
    ]
}

你可能感兴趣的:(坑,c++)