When working with POSIX threads in a C program, I found "undefined reference to pthread create" error.
#include <stdio.h>
#include <stdlib.h>
void *myThreadFun(void *vargp)
{
sleep(1);
printf("Printing Sample \n");
return NULL;
}
Although my gcc and g++ compilers are working pretty fine. Moreover, I am compiling this code using this command:
gcc test.c -o test