Blue Sky
Blue Sky

Reputation: 323

Where to download POSIX pthread?

From where I can download the POSIX pthread library? I want to use pthread for both Windows (using gcc in MingW) and Linux. I found a link in sourceforge.net but it looks it is for Windows. Any help? Thanks!

Upvotes: 0

Views: 2415

Answers (2)

Skakun Roman
Skakun Roman

Reputation: 21

Default installation of MinGW does not include pthread library. You must install additional packages: mingw32-libpthreadgc-dll, mingw32-libpthreadgc-dev. Do not forget to install gcc compiler. The example of compile command: gcc file_name.c -Wall -pthread -o file_name

To install new packages, you should use console command mingw-get or GUI packet manager.

If you’re using Ubuntu, you must execute of following command: sudo apt-get install libc6 libc6-dev -y

Upvotes: 2

user1937198
user1937198

Reputation: 5348

There isn't a specific pthread library. Posix defines the interfaces that each system library must follow. Must modern linux distros will have libpthread installed or you can download it with youre package manage. On windows In is usually better to use the windows api as there is no explicit support for pthreads.

Upvotes: 1

Related Questions