ios - IBM MobileFirst 7.0 - libstdc++.6.dylib 上的 Xcode 10.1/iOS 12 问题

标签 ios xcode ibm-mobilefirst

我们在移动应用程序开发中使用 MFP 7.0。在 Xcode 9 上,我们没有任何问题,所有应用程序都运行顺利。 当 Xcode 10 和 iOS 12 发布时,我们升级了 MacBook,但在编译过程中遇到了问题。我们按照论坛的建议添加了库 libstdc++.6.dylib。当我们在模拟器上运行时它工作正常,但如果我们尝试在真实设备(iPhone/iPad)中测试,我们会收到错误消息“../native/Frameworks/libstdc++.6.dylib,缺少所需的架构arm64 “

这是当我运行针对我的 iPhone 设备的应用程序时,我的 Xcode 中的实际警告/错误日志:

ld: warning: ignoring file /Users/jm/Documents/App/native/Frameworks/libstdc++.6.dylib, missing required architecture arm64 in file /Users/jm/Documents/App/native/Frameworks/libstdc++.6.dylib (2 slices) Undefined symbols for architecture arm64: "std::basic_ostringstream, std::allocator >::basic_ostringstream(std::_Ios_Openmode)", referenced from: +[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o) "std::ostream::operator<<(double)", referenced from: +[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o) "std::string::c_str() const", referenced from: +[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o) "std::basic_string, std::allocator >::~basic_string()", referenced from: +[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o) "std::basic_ostringstream, std::allocator >::str() const", referenced from: +[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o) "std::basic_ostringstream, std::allocator >::~basic_ostringstream()", referenced from: +[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

:-1: ignoring file /Users/jm/Documents/App/native/Frameworks/libstdc++.6.dylib, missing required architecture arm64 in file /Users/jm/Documents/App/native/Frameworks/libstdc++.6.dylib (2 slices)

:-1: symbol(s) not found for architecture arm64

:-1: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

我尝试在 MFP v6.2 上执行以下操作,该操作在设备上运行良好。你也可以尝试一下。您能否从复制 stdlibc++ 库的位置提供问题的更多详细信息。

  1. 来自您的 Xcode 9 计算机

复制文件:(libstdc++.6.0.9.tbd) 和 (libstdc++.6.tbd) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib 和 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib

  • 粘贴到 Xcode 10 计算机上的以下路径
  • 将文件:(libstdc++.6.0.9.tbd) 和 (libstdc++.6.tbd) 复制到: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib

    (请注意“iPhoneOS”和“iPhoneSimulator”的区别)

  • 将复制的库(libstdc++.6.0.9.tbd)和(libstdc++.6.tbd)添加到Xcode项目的“构建阶段->链接库”路径中。

  • 清理 xcode 并重建它。

  • 在 iOS 12 设备上执行
  • 注意:对于 /usr/lib/libstdc++.6.dylib: mach-o, but notbuilt for iOS Simulator 的模拟器问题,可以尝试复制原始文件:libstdc++.6.0.9 .dylib 和 libstdc++.6.dylib 和 libstdc++.dylib 到: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/资源/RuntimeRoot/usr/lib

    但有时即使这样做也不起作用,建议在iOS 11模拟器上运行

    关于ios - IBM MobileFirst 7.0 - libstdc++.6.dylib 上的 Xcode 10.1/iOS 12 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53440249/

    相关文章:

    iphone - iOS - 在不使用 UIScrollView 的情况下通过 Quicklook 打开 PDF

    ios - EXC_BAD_ACCESS 在尝试扩展 UIView 类时

    ios - apple mach-o linker error 链接器命令失败,退出代码为 1(使用 -v 查看调用)

    ios facebook 喜欢 objective-c 中的 react

    desktop-application - IBM Worklight - 我们可以创建基于桌面的应用程序吗?

    ios - X代码 4.2 : Deleted Resources still referenced in project (red filenames)

    ios - ScrollView - 手势识别器 - 垂直滑动

    ios - 未调用 IBM MFP onReadyToSubscribe 方法

    ibm-mobilefirst - CloudantSync与JSONStore

    objective-c - 是否有针对 Mac 和 iOS Cocoa/Objective C 的任何商业附加编程控件?