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

房东的猫 提交于 2019-12-24 16:27:12

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/34851876/declaration-of-setxattr-must-be-imported-from-module-darwin-posix-sys-xattr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!