【问题标题】:enabling pthread on vscode using code runner extension on linux wsl?在 linux wsl 上使用代码运行器扩展在 vscode 上启用 pthread?
【发布时间】:2022-01-16 16:23:22
【问题描述】:

我在 VS Code 上使用带有 Code runner 的 Posix 线程时在 Linux 上遇到了一个错误,并且遇到了 undefined reference to pthread_create() 的错误;

【问题讨论】:

    标签: visual-studio-code pthreads posix vscode-code-runner coderunner


    【解决方案1】:

    要修复它,请在代码运行器 settings.json 中添加 -pthread 参数:

        "cpp": "cd $dir && g++ $fileName -pthread -o $fileNameWithoutExt && 
    

    【讨论】:

    • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 1970-01-01
    • 2021-05-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-17
    • 1970-01-01
    相关资源
    最近更新 更多