Getting errors at compile time

48 views
Skip to first unread message

Vikalp Mishra

unread,
Mar 30, 2021, 1:40:28 AM3/30/21
to j2objc-discuss
Hello Tom,

I am getting some compile time error while using the JsonObject conversion with 64 Bit Architecture.

Undefined symbols for architecture arm64:

  "_OBJC_CLASS_$_JavaxNetSslHttpsURLConnection", referenced from:

      objc-class-ref in CRBaseApiRequest.o

  "_OBJC_EHTYPE_$_JavaNetSocketTimeoutException", referenced from:

      GCC_except_table6 in CRBaseApiRequest.o

  "_AndroidUtilLog_dWithNSString_withNSString_", referenced from:

      -[CRActivationBaseFileRetriever retrieveWithTimeoutWithJavaUtilMap:withInt:withInt:] in CRActivationBaseFileRetriever.o

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)


Please have a look on same and suggest your ideas.


Regards,

Vikalp Mishra

Tom Ball

unread,
Mar 30, 2021, 11:59:40 AM3/30/21
to j2objc-discuss
The short answer is to link with the -ljre_emul flag, either using the j2objcc script or in the Other Linker Flags in Xcode. The JRE emulation layer is split into subsets to reduce app size, with jre_core as the minimum. Apps that use classes that aren't in jre_core need to either link in the whole JRE emulation layer with -ljre_emul, or add the necessary subset libraries. It's easiest if you develop using -ljre_emul so link errors like this don't show up, and only figure out which subsets to use when you want to shrink your app before releasing it.

Here are the specific subset libraries, which should show how any future undefined symbol messages can be resolved in the future:
  • _OBJC_CLASS_$_JavaxNetSslHttpsURLConnection is the JavaxNetSslHttpsURLConnection class object (just strip off the prefix), which is generated from javax.net.ssl.HttpsURLConnection (see class naming), which is in the jre_ssl subset library.
  • _OBJC_EHTYPE_$_JavaNetSocketTimeoutException => JavaNetSocketTimeoutException => java.net.SocketTimeoutException => jre_net
  • _AndroidUtilLog_dWithNSString_withNSString_ => android.util.Log.d(String, String) => android_util

--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/j2objc-discuss/28f318ef-1c58-4ea2-b2ce-7fafba2b1fc8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages