[英]How to use pthread header file in C project in CLion which uses MinGW in windows
我正在尝试在使用 CLion 的项目中包含#include <pthread.h>
,但我不能直接使用它。 是否有任何特定方法可以将 pthread 包含到 C 项目中?
我终于想出了一个解决方案。 由于我使用的是 MinGW,我使用了 MinGW 安装管理器并安装了需要在 CLion 中执行 pthreads 和 openmp 相关任务的包。 这是程序。
After opening the installation manager go to all packages and select the select packages named using mingw32-pthreads-w32 and select them for installation.
然后 go 到 installtion -> Apply changes to install new packages。 您可以在 c 或 c++ 程序中使用 pthread.h 和 omp.h 没有任何问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.