0
votes

I have a problem to link the j2objc library as a subproject. It always ends up with "missing libjre_emul.a" error.

Steps I have done:

1) Create empty iOS project

2) Include j2objc library by following the simple steps in the part "Including JreEmulation project into your project.

I checked that I am building for the iPhone simulator and the build process is running. It seems that libjre_emul.a is generated at j2objc/jre_emul/build_result/ but it should be also available in the DerivedData, which is not. I have also tried setting a shared folder for DerivedData (File -> Project settings -> Derived Data -> Advanced), but this didn't help.

The reason why I would like to include it as a subproject is to be able to set breakpoints inside j2objc source.

Here is the error:

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

1 Answers

1
votes

Tom Ball responded on the 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.

So it was a bug, but I still can't debug/step into the j2objc source code. But at least this is working.