vscode 远程 Ubuntu 静态连接 pthread,执行报错:segmentation fault

    科技2024-12-02  16

    参考链接: https://stackoverflow.com/questions/58848694/gcc-whole-archive-recipe-for-static-linking-to-pthread-stopped-working-in-rec

    vscode task.json 设置:

    "args": [ "-g", "${file}", "-std=c++17", "-Wall", "-static", "-Wl,--whole-archive", "-lrt", "-lpthread", "-Wl,--no-whole-archive", "-o", "${fileDirname}/a.out" ],

    注意-Wl后边逗号前后没有空格。

    Processed: 0.009, SQL: 8