undefined reference to `pthread_create’ collect2: ld returned 1 exit status


Cause of the problem: the
pthread library is not the default library on Linux systems, and you need to use the static library libpthread.a to connect, so you need to link the library when you create a thread using pthread_create() and when you call the pthread_atfork() function to create a fork handler.

add -lpthread parameter
GCC mult-tcp-server. c-o mult-tcp-server. lpthread
mult-tcp-server. c for your source file, don’t forget to add header #include< pthread.h>

Read More: