1

I import j2objc to my project, but I still get error like Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_Test (public class Test in java source). I found something about wrong linking static library to project (libjre_emul.a). I found possible official solution add to Other Linker Flags flag "-l jre_emul".

Problem is I get error ld: library not found for -l jre_emul what does it mean? How can I fix this?

I tried extended command:

"-l jre_emul -ObjC -force_load ${PROJECT_DIR}/lib/libjre_emul.a"

Error library not found still remains. Any idea?

Thanks.

eSeverus
  • 552
  • 1
  • 6
  • 18

2 Answers2

1

I think you have a spelling error in your other linker flags. Try to use something like:

-l"jre_emul"
Michael
  • 32,527
  • 49
  • 210
  • 370
0

The -force_load flag is no longer necessary. The issue is that the linker can't find the library because the path to it is not defined in your project (it's probably not in ${PROJECT_DIR}/lib, unless you explicitly put it there). The Update the Build Settings wiki section describes how to add the J2ObjC distribution path to your project's Library Search Paths build setting.

tball
  • 1,984
  • 11
  • 21