undefined reference to'pthread_create' 这个错误通常是在使用 pthread 库时遇到的,它表明程序找不到 pthread_create 函数的定义。 问题解决 1. 添加编译选项 在使用 pthread 库时,需要在编译时添加相应的选项-pthread,例如: g++-pthread main.cpp-o main ...