我編譯並鏈接了使用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