Declaration of ‘setxattr’ must be imported from module ‘Darwin.POSIX.sys.xattr’ before it is required
Asked Answered
V

1

3

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);

any help plz?

Vibrator answered 18/1, 2016 at 9:59 Comment(0)
V
14

I found the solution. include #include <sys/xattr.h> in the class

Vibrator answered 25/1, 2016 at 11:48 Comment(1)
In my case I had to #import <sys/utsname.h>Underlinen

© 2022 - 2024 — McMap. All rights reserved.