2013-05-20 69 views
0

我有一個問題,鏈接j2objc庫作爲子項目。它總是以「缺少libjre_emul.a」錯誤結束。j2objc作爲XCode中的子項目

步驟我都做:

1)創建空的iOS項目

2)以下的部分simple steps「包括JreEmulation項目到您的項目包括j2objc庫

我檢查。我正在構建iPhone模擬器,並且構建過程正在運行,似乎libjre_emul.a是在j2objc/jre_emul/build_result /中生成的,但它應該也可以在DerivedData中使用,不過我也嘗試設置shared 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: error: no such file or directory: '/Users/user/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/libjre_emul.a'

回答

1

湯姆球迴應對j2obj google group

The problem looks to be that the JreEmulation project's makefile is not copying the built library to where Xcode expects it to be. Xcode used to pass build environment variables like BUILT_PRODUCTS_DIR to external build system targets, but doesn't any more. Here's a workaround until I figure out how to fix embedding JreEmulation properly (if anyone has a solution, please reply):

  • Remove the red libjre_emul.a from your project's Link Binary with Libraries list.

  • In that list, click the + button, then Add Other...

  • Go to your j2objc directory, then dist/lib and add libjre_emul.a

Now when you look at the link list, libjre_emul.a should be red after cleaning your project (since it was deleted), and black after your project builds successfully.

所以這是一個錯誤,但我仍然無法調試/踏進j2objc源代碼。但至少這是工作。