【问题标题】:stat() unavailable in ios simulator?stat()在ios模拟器中不可用?
【发布时间】:2014-08-27 20:14:41
【问题描述】:

我已经编译并链接了使用 stat() 且没有错误的 lib (libclang) 的 ios 应用程序。但我遇到了运行时错误:

2014-07-07 16:55:14.138 LibClangUsage7Demo[74938:60b] 开始检测 尝试调用系统库中不存在的符号 iPhone:从函数调用的 stat$INODE64 _ZN4llvm3sys2fs6statusERKNS_5TwineERNS1_11file_statusE 在图像 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);
}

我如何能够在没有 stat() 符号的情况下链接应用程序?我该如何修复/绕过它?

PS。我可以看到 iOS(模拟器?)支持stathttps://developer.apple.com/library/prerelease/ios/documentation/System/Conceptual/ManPages_iPhoneOS/man2/stat.2.html

【问题讨论】:

    标签: ios xcode clang llvm stat


    【解决方案1】:

    iOS 不支持我 was said stat

    【讨论】:

      【解决方案2】:

      问题是您为 OSX 构建了 libclang 并将其链接到 iOS 可执行文件中。您需要为正确的平台构建 libclang。

      iOS 肯定支持 stat。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-03-11
        • 2020-07-15
        • 1970-01-01
        • 1970-01-01
        • 2011-08-28
        • 2015-12-21
        • 2012-08-12
        • 2023-03-25
        相关资源
        最近更新 更多