【问题标题】:Declaration of ‘setxattr’ must be imported from module ‘Darwin.POSIX.sys.xattr’ before it is required在需要之前,必须从模块“Darwin.POSIX.sys.xattr”中导入“setxattr”声明
【发布时间】:2016-04-23 10:56:15
【问题描述】:

代码在 armv7 上运行良好,但为 arm64 编译会抛出“必须在需要之前从模块‘Darwin.POSIX.sys.xattr’中导入‘setxattr’声明”错误。

u_int8_t b = 1;
    setxattr([path fileSystemRepresentation],
             "com.apple.MobileBackup", &b, 1, 0, 0);

有什么帮助吗?

【问题讨论】:

    标签: ios objective-c armv7 arm64


    【解决方案1】:

    我找到了解决方案。 在类中包含#include <sys/xattr.h>

    【讨论】:

    • 就我而言,我必须#import
    猜你喜欢
    • 2022-09-26
    • 2016-12-26
    • 2018-07-08
    • 2019-12-05
    • 2016-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多