本文共 708 字,大约阅读时间需要 2 分钟。
今天在使用CPU亲和性的相关接口时会报出
error:implicit declaration of function 'CPU_ZERO' [-Werror=implicit-function-declaration]
解决办法是文件中添加 #define _GNU_SOURCE从而打开一些编译特性
/* If _GNU_SOURCE was defined by the user, turn on all the other features. */#ifdef _GNU_SOURCE# undef _ISOC99_SOURCE# define _ISOC99_SOURCE 1# undef _POSIX_SOURCE# define _POSIX_SOURCE 1# undef _POSIX_C_SOURCE# define _POSIX_C_SOURCE 200112L# undef _XOPEN_SOURCE# define _XOPEN_SOURCE 600# undef _XOPEN_SOURCE_EXTENDED# define _XOPEN_SOURCE_EXTENDED 1# undef _LARGEFILE64_SOURCE# define _LARGEFILE64_SOURCE 1# undef _BSD_SOURCE# define _BSD_SOURCE 1# undef _SVID_SOURCE# define _SVID_SOURCE 1# undef _ATFILE_SOURCE# define _ATFILE_SOURCE 1#endif
转载地址:http://bouyn.baihongyu.com/