I compile this code main.c in CentOS7 with gcc:
#include void* mystart(void* arg) { pthread_yield(); return(0); } int main(void) {
You should use -pthread for compile and link. It not only links the library, it also sets preprocessor defines and sometimes selects a different runtime library (on Windows for example).
-pthread