【问题标题】:j2objc as subproject in XCodej2objc 作为 XCode 中的子项目
【发布时间】:2013-05-20 18:58:19
【问题描述】:

我在将j2objc 库链接为子项目时遇到问题。它总是以“缺少 libjre_emul.a”错误结束。

我已经完成的步骤:

1) 创建空的 iOS 项目

2) 按照“将 JreEmulation 项目包含到您的项目中”部分中的 simple steps 来包含 j2objc 库。

我检查了我正在为 iPhone 模拟器构建并且构建过程正在运行。似乎 libjre_emul.a 是在 j2objc/jre_emul/build_result/ 生成的,但它也应该在 DerivedData 中可用,但事实并非如此。我也尝试为 DerivedData 设置一个共享文件夹(文件 -> 项目设置 -> 派生数据 -> 高级),但这没有帮助。

之所以要将它作为子项目包含在内,是为了能够在 j2objc 源代码中设置断点。

这是错误:

ld /Users/user/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SubProject4.app/SubProject4 正常 i386 cd /Users/user/Documents/Project1/SubProject4 setenv IPHONEOS_DEPLOYMENT_TARGET 6.1 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/ usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6。 1.sdk -L/Users/user/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator -F/Users/user/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator -filelist/用户/用户/库/开发人员/Xcode/DerivedData/Build/Intermediates/SubProject4.build/Debug-iphonesimulator/SubProject4.build/Objects-normal/i386/SubProject4.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 /Users/user/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/libjre_emul.a -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/user/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SubProject4.app/SubProject4

clang:错误:没有这样的文件或目录:'/Users/user/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/libjre_emul.a'

【问题讨论】:

    标签: ios objective-c xcode macos


    【解决方案1】:

    Tom Ball 回复 j2obj google group:

    问题似乎是 JreEmulation 项目的 makefile 没有将构建的库复制到 Xcode 期望的位置。 Xcode 用于将构建环境变量(如 BUILT_PRODUCTS_DIR)传递给外部构建系统目标,但现在不再这样了。在我弄清楚如何正确修复嵌入 JreEmulation 之前,这是一种解决方法(如果有人有解决方案,请回复):

    • 从项目的 Link Binary with Libraries 列表中删除红色的 libjre_emul.a。

    • 在该列表中,单击 + 按钮,然后单击添加其他...

    • 转到您的 j2objc 目录,然后 dist/lib 并添加 libjre_emul.a

    现在,当您查看链接列表时,libjre_emul.a 在清理您的项目后应该是红色的(因为它已被删除),在您的项目构建成功后应该是黑色的。

    所以这是一个错误,但我仍然无法调试/进入 j2objc 源代码。但至少这是有效的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多