#include
#include
#include
#include
void *myThread(void *arg)
{
printf("thread ran\n");
pthread_exit(arg);
}
int main()
{
int ret;
pthread_t mythread;
ret=pthread_create(&mythread,NULL,myThread,NULL);//为什么会报错啊
if(ret !=0)
{
printf("can't create pthread(%s)\n",strerror(errno));
exit(-1);
}
return 0;
}
[attach]32200[/attach]
为什么会报错啊。。那个pthread.h头文件 明明是有的!!!
[attach]32201[/attach]
yezhubenyue 于 2010-09-21 22:27:53发表:
恩,,行了。。谢谢楼上的~~~~~~~~~
yezhubenyue 于 2010-09-21 22:27:25发表:
恩,,行了。。谢谢楼上的~~~~~~~~~
MemoryZA 于 2010-09-21 20:36:18发表:
路过,期待解答
deepwhite 于 2010-09-21 18:56:27发表:
需要 pthread 库,试试:
gcc test.c -lpthread
yezhubenyue 于 2010-09-21 14:28:55发表:
等待解答!!!!!!!!!!!!!!!!