libgcc_s.so.1 must be installed for pthread_cancel to work Ubuntu19.04使用gcc编译时出现上述错误: 线程涉及第三方库gcc在编译时不会自动帮我们链接添加,需要手动加上-pthread链接线程库。 将gcc pthrd_test.c -o pthrd_test改为 gcc pthrd_test.c -o pthrd_test -pthread即可。