POSIX警告 - 函数'pthread_yield'的隐式声明 [英] POSIX Warning - implicit declaration of function ‘pthread_yield’
本文介绍了POSIX警告 - 函数'pthread_yield'的隐式声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
出于某种原因,我收到警告隐式声明函数'pthread_yield'。我已经包含在我的代码< pthread.h>中了。我在Debian 7 32位下运行程序。
根据手册,我做对了
http://man7.org/linux/man-pages/man3/pthread_yield.3.html [ ^ ]
非常感谢任何帮助。
谢谢
Hi,
For some reason I'm getting the warning implicit declaration of function ‘pthread_yield’. I already included in my code <pthread.h>. I'm running the program under Debian 7 32 bit.
According to the manual, I'm doing it right
http://man7.org/linux/man-pages/man3/pthread_yield.3.html[^]
Any help will be very much appreciated.
Thanks
推荐答案
以下内容适用于我:
The following works for me:
#define _GNU_SOURCE
#include <pthread.h>
int main()
{
pthread_yield();
return 0;
}
用
compiled with the
gcc -Wall -o myprog myprog.c -lpthread
命令行。
command line.
这篇关于POSIX警告 - 函数'pthread_yield'的隐式声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文