本文介绍了找不到`pthread_setaffinity_np'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将-pthread用于gcc编译器,但仍然找不到此API.有什么建议吗?

I used -pthread for gcc compiler, but still can not find this API. any suggestion?

推荐答案

这是非标准的GNU扩展,正如手册和后缀_np会告诉您的那样,因此请包含以下标头:

It's a non-standard GNU extension, as the manual and the suffix _np will tell you, so include the header like this:

#define _GNU_SOURCE
#include <pthread.h>

这篇关于找不到`pthread_setaffinity_np'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 19:24