Difference between -pthread and -lpthread while compiling
-pthread tells the compiler to link in the pthread library as well as configure the compilation for threads. For example, the following shows the macros that get defined when the -pthread option gets used on the GCC package installed on my Ubuntu machine: $ gcc -pthread -E -dM test.c > dm.pthread.txt $ gcc -E -dM … Read more