Can I get Unix's pthread.h to compile in Windows?

后端 未结 5 838
囚心锁ツ
囚心锁ツ 2020-11-27 17:14

If I try to compile a program with

#include 

in it, I get the error:

pthread.h: No such file or directory
         


        
5条回答
  •  情歌与酒
    2020-11-27 17:23

    There are, as i recall, two distributions of the gnu toolchain for windows: mingw and cygwin.

    I'd expect cygwin work - a lot of effort has been made to make that a "stadard" posix environment.

    The mingw toolchain uses msvcrt.dll for its runtime and thus will probably expose msvcrt's "thread" api: _beginthread which is defined in

提交回复
热议问题