I have to convert java code to objective-c code. Here I have to write the following code and run on my terminal:
$ cat Hello.java
public class Hello {
public static void main(String[] args) {
System.out.println("hello, world");
}
}
$ j2objc Hello.java
translating Hello.java
Translated 1 file: 0 errors, 0 warnings
To compile the translated file:
$ j2objcc -c Hello.m
$ j2objcc -o hello Hello.o
Here when I run $ j2objcc -o hello Hello.o on my terminal, I get the following error.
$ j2objcc -o hello Hello.o
Undefined symbols:
"_objc_autoreleasePoolPop", referenced from:
-[JavaLangThread run] in libjre_emul.a(Thread.o)
"_objc_autoreleasePoolPush", referenced from:
-[JavaLangThread run] in libjre_emul.a(Thread.o)
ld: symbol(s) not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I resolve this error?