我编译并链接了使用lib(libclang)的ios应用程序,该应用程序使用stat()而没有错误。但我有运行时错误:stat()在ios模拟器中不可用?
2014-07-07 16:55:14.138 LibClangUsage7Demo[74938:60b] started Detected an attempt to call a symbol in system libraries that is not present on the iPhone: stat$INODE64 called from function _ZN4llvm3sys2fs6statusERKNS_5TwineERNS1_11file_statusE in image LibClangUsage7Demo.
LLVM代码引发错误的是(/Unix/Path.inc):
error_code status(const Twine &Path, file_status &Result) {
SmallString<128> PathStorage;
StringRef P = Path.toNullTerminatedStringRef(PathStorage);
struct stat Status;
int StatRet = ::stat(P.begin(), &Status); // failure here
return fillStatus(StatRet, Status, Result);
}
我怎么能够无需统计应用程序链接()在符号?我如何修复/漫步它?
PS。我可以看到stat
由iOS的支持(模拟器): https://developer.apple.com/library/prerelease/ios/documentation/System/Conceptual/ManPages_iPhoneOS/man2/stat.2.html