j2objc作为XCode中的子项目

时间:2013-05-20 18:58:19

标签: ios objective-c xcode macos

我将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 normal 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 / Users / user / Library / Developer / 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 / DelivedData / Build / Products / Debug -iphonesimulator / libjre_emul.a'

1 个答案:

答案 0 :(得分:1)

汤姆鲍尔回应了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源代码。但至少这是有效的。