libgcc_s.so.1 must be installed for pthread_cancel to work

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即可。

发布了8 篇原创文章 · 获赞 0 · 访问量 129

猜你喜欢

转载自blog.csdn.net/oykotxuyang/article/details/105388448