必须先从模块"Darwin.POSIX.sys.xattr"导入"setxattr"的声明 [英] Declaration of ‘setxattr’ must be imported from module ‘Darwin.POSIX.sys.xattr’ before it is required
本文介绍了必须先从模块"Darwin.POSIX.sys.xattr"导入"setxattr"的声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
代码在armv7上工作正常,但为arm64编译会引发此必须在模块'Darwin.POSIX.sys.xattr'中导入'setxattr'的声明"错误.
code is working fine on armv7 but compile for arm64 throws this "Declaration of ‘setxattr’ must be imported from module ‘Darwin.POSIX.sys.xattr’ before it is required" error.
u_int8_t b = 1;
setxattr([path fileSystemRepresentation],
"com.apple.MobileBackup", &b, 1, 0, 0);
有什么帮助吗?
推荐答案
我找到了解决方案.在类中包含 #include< sys/xattr.h>
I found the solution.
include #include <sys/xattr.h>
in the class
这篇关于必须先从模块"Darwin.POSIX.sys.xattr"导入"setxattr"的声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文