在编译时已经加了-lpthread,还是有这个问题。 pthread_atfork是POSIX标准,在编译时要加上-pthread -lpthread是老版本的gcc编译器用的,在新版本中应该用-pthread取代-lpthread