Linux对使用prhread_create未定义问题的解决
从网上搜了一下解决办法,大部分的解决方法是:

由于pthread库不是Linux系统默认的库,连接时需要使用库libpthread.a,所以在使用pthread_create创建线程时,在编译中要加-l pthread参数:
gcc demo.c -lpthread -o example

Logo

更多推荐