我在将j2objc库链接为子项目时遇到问题。它总是以“缺少 libjre_emul.a”错误结束。
我已经完成的步骤:
1)创建空的iOS项目
2) 按照“将 JreEmulation 项目包含到您的项目中”部分中的简单步骤包含 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 /Users/用户/库/开发人员/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/SubProject4build/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/SubProject4build/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/SubProject4a -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/user/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SubProject4.app/SubProject4a -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'