Building with Luasec for Android bundle

#1

Hi, I’m building a game with Luasec extension. Defold builds the bundles well for iOS, MacOS but I get build errors as below for Android bundle. It seems OpenSSL version is not matching and currently I have no idea how to fix it. What should I do to resolve this problem?

/luasec/include/openssl/x509.h
	Line 97: undefined reference to `OPENSSL_sk_num'
	Line 97: undefined reference to `OPENSSL_sk_value'
	Line 97: undefined reference to `OPENSSL_sk_new_null'
	Line 97: undefined reference to `OPENSSL_sk_push'
	Line 97: undefined reference to `OPENSSL_sk_free'
/luasec/include/openssl/x509v3.h
	Line 165: undefined reference to `OPENSSL_sk_num'
	Line 165: undefined reference to `OPENSSL_sk_value'
/luasec/src/context.c
	Line 97: undefined reference to `TLS_method'
	Line 98: undefined reference to `TLS_method'
	Line 102: undefined reference to `TLSv1_method'
	Line 102: 'TLSv1_method' is deprecated [-Wdeprecated-declarations]
  if (!strcmp(method, "tlsv1"))   return TLSv1_method();
                                         ^
	Line 104: undefined reference to `TLSv1_1_method'
	Line 104: 'TLSv1_1_method' is deprecated [-Wdeprecated-declarations]
  if (!strcmp(method, "tlsv1_1")) return TLSv1_1_method();
                                         ^
	Line 105: undefined reference to `TLSv1_2_method'
	Line 105: 'TLSv1_2_method' is deprecated [-Wdeprecated-declarations]
  if (!strcmp(method, "tlsv1_2")) return TLSv1_2_method();
                                         ^
	Line 182: undefined reference to `X509_verify_cert_error_string'
	Line 196: undefined reference to `SSL_get_SSL_CTX'
	Line 197: undefined reference to `SSL_CTX_get_ex_data'
	Line 216: undefined reference to `BIO_new_mem_buf'
	Line 219: undefined reference to `PEM_read_bio_DHparams'
	Line 220: undefined reference to `BIO_free'
	Line 229: undefined reference to `DH_free'
	Line 229: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
	Line 244: undefined reference to `SSL_CTX_get_ex_data'
	Line 258: undefined reference to `X509_STORE_CTX_get0_param'
	Line 260: undefined reference to `X509_VERIFY_PARAM_set_purpose'
	Line 261: undefined reference to `X509_VERIFY_PARAM_set_trust'
	Line 265: undefined reference to `X509_verify_cert'
	Line 284: undefined reference to `X509_STORE_CTX_get_ex_data'
	Line 285: undefined reference to `SSL_get_ex_data_X509_STORE_CTX_idx'
	Line 286: undefined reference to `SSL_get_SSL_CTX'
	Line 287: undefined reference to `SSL_CTX_get_ex_data'
	Line 298: undefined reference to `X509_STORE_CTX_get_error'
	Line 300: undefined reference to `X509_STORE_CTX_get_error_depth'
	Line 342: undefined reference to `SSL_CTX_new'
	Line 346: undefined reference to `ERR_get_error'
	Line 346: undefined reference to `ERR_reason_error_string'
	Line 355: undefined reference to `SSL_CTX_ctrl'
	Line 357: undefined reference to `SSL_CTX_set_ex_data'
	Line 370: undefined reference to `BIO_new_mem_buf'
	Line 376: undefined reference to `ERR_get_error'
	Line 376: undefined reference to `ERR_reason_error_string'
	Line 381: undefined reference to `PEM_read_bio_X509'
	Line 385: undefined reference to `ERR_get_error'
	Line 385: undefined reference to `ERR_reason_error_string'
	Line 387: undefined reference to `BIO_free'
	Line 391: undefined reference to `BIO_free'
	Line 394: undefined reference to `SSL_CTX_get_cert_store'
	Line 395: undefined reference to `X509_STORE_add_cert'
	Line 399: undefined reference to `ERR_get_error'
	Line 399: undefined reference to `ERR_reason_error_string'
	Line 401: undefined reference to `X509_free'
	Line 405: undefined reference to `X509_free'
	Line 420: undefined reference to `ERR_clear_error'
	Line 423: undefined reference to `SSL_CTX_get_default_passwd_cb'
	Line 424: undefined reference to `SSL_CTX_get_default_passwd_cb_userdata'
	Line 426: undefined reference to `PEM_read_bio_X509_AUX'
	Line 429: undefined reference to `ERR_put_error'
	Line 433: undefined reference to `SSL_CTX_use_certificate'
	Line 435: undefined reference to `ERR_peek_error'
	Line 447: undefined reference to `SSL_CTX_ctrl'
	Line 454: undefined reference to `PEM_read_bio_X509'
	Line 457: undefined reference to `SSL_CTX_ctrl'
	Line 465: undefined reference to `X509_free'
	Line 471: undefined reference to `ERR_peek_last_error'
	Line 474: undefined reference to `ERR_clear_error'
	Line 480: undefined reference to `X509_free'
	Line 481: undefined reference to `BIO_free'
	Line 492: undefined reference to `BIO_new_mem_buf'
	Line 498: undefined reference to `ERR_get_error'
	Line 498: undefined reference to `ERR_reason_error_string'
	Line 519: undefined reference to `SSL_CTX_set_default_passwd_cb'
	Line 520: undefined reference to `SSL_CTX_set_default_passwd_cb_userdata'
	Line 523: undefined reference to `BIO_new_mem_buf'
	Line 524: undefined reference to `SSL_CTX_get_default_passwd_cb'
	Line 524: undefined reference to `SSL_CTX_get_default_passwd_cb_userdata'
	Line 524: undefined reference to `PEM_read_bio_PrivateKey'
	Line 525: undefined reference to `SSL_CTX_use_PrivateKey'
	Line 532: undefined reference to `ERR_get_error'
	Line 532: undefined reference to `ERR_reason_error_string'
	Line 535: undefined reference to `EVP_PKEY_free'
	Line 536: undefined reference to `BIO_free'
	Line 538: undefined reference to `SSL_CTX_set_default_passwd_cb'
	Line 539: undefined reference to `SSL_CTX_set_default_passwd_cb_userdata'
	Line 555: undefined reference to `SSL_CTX_check_private_key'
	Line 566: undefined reference to `SSL_CTX_set_cipher_list'
	Line 569: undefined reference to `ERR_get_error'
	Line 569: undefined reference to `ERR_reason_error_string'
	Line 582: undefined reference to `SSL_CTX_set_verify_depth'
	Line 605: undefined reference to `SSL_CTX_set_verify'
	Line 636: undefined reference to `SSL_CTX_set_options'
	Line 670: undefined reference to `SSL_CTX_set_tmp_dh_callback'
	Line 698: undefined reference to `SSL_CTX_set_options'
	Line 701: undefined reference to `SSL_CTX_ctrl'
	Line 777: undefined reference to `SSL_CTX_free'
	Line 781: undefined reference to `DH_free'
	Line 827: undefined reference to `SSL_CTX_get_verify_mode'
	Line 827: undefined reference to `SSL_CTX_set_verify'
	Line 828: undefined reference to `SSL_CTX_set_cert_verify_callback'
	Line 835: undefined reference to `SSL_CTX_get_verify_mode'
	Line 835: undefined reference to `SSL_CTX_set_verify'
	Line 836: undefined reference to `SSL_CTX_set_cert_verify_callback'
	Line 845: undefined reference to `SSL_CTX_get_cert_store'
	Line 845: undefined reference to `X509_STORE_set_flags'
/luasec/src/ssl.c
	Line 71: undefined reference to `ERR_get_error'
	Line 71: undefined reference to `ERR_reason_error_string'
	Line 86: undefined reference to `SSL_shutdown'
	Line 103: undefined reference to `SSL_free'
	Line 119: undefined reference to `ERR_clear_error'
	Line 120: undefined reference to `SSL_do_handshake'
	Line 121: undefined reference to `SSL_get_error'
	Line 137: undefined reference to `ERR_peek_error'
	Line 163: undefined reference to `ERR_clear_error'
	Line 164: undefined reference to `SSL_write'
	Line 165: undefined reference to `SSL_get_error'
	Line 181: undefined reference to `ERR_peek_error'
	Line 207: undefined reference to `ERR_clear_error'
	Line 208: undefined reference to `SSL_read'
	Line 209: undefined reference to `SSL_get_error'
	Line 227: undefined reference to `ERR_peek_error'
	Line 261: undefined reference to `SSL_new'
	Line 265: undefined reference to `ERR_get_error'
	Line 265: undefined reference to `ERR_reason_error_string'
	Line 269: undefined reference to `SSL_set_fd'
	Line 270: undefined reference to `SSL_ctrl'
	Line 273: undefined reference to `SSL_ctrl'
	Line 276: undefined reference to `SSL_set_accept_state'
	Line 278: undefined reference to `SSL_set_connect_state'
	Line 343: undefined reference to `SSL_set_fd'
	Line 389: undefined reference to `SSL_pending'
	Line 402: undefined reference to `SSL_want'
	Line 428: undefined reference to `SSL_get_current_compression'
	Line 430: undefined reference to `SSL_COMP_get_name'
	Line 460: undefined reference to `SSL_get_peer_certificate'
	Line 470: undefined reference to `SSL_is_server'
	Line 472: undefined reference to `SSL_get_peer_cert_chain'
	Line 480: undefined reference to `X509_up_ref'
	Line 502: undefined reference to `SSL_is_server'
	Line 503: undefined reference to `SSL_get_peer_certificate'
	Line 506: undefined reference to `SSL_get_peer_cert_chain'
	Line 512: undefined reference to `X509_up_ref'
	Line 552: undefined reference to `SSL_get_verify_result'
	Line 561: undefined reference to `X509_verify_cert_error_string'
	Line 585: undefined reference to `SSL_get_finished'
	Line 593: undefined reference to `SSL_get_finished'
	Line 612: undefined reference to `SSL_get_peer_finished'
	Line 620: undefined reference to `SSL_get_peer_finished'
	Line 661: undefined reference to `SSL_get_current_cipher'
	Line 664: undefined reference to `SSL_CIPHER_description'
	Line 665: undefined reference to `SSL_CIPHER_get_bits'
	Line 669: undefined reference to `SSL_get_version'
	Line 677: undefined reference to `SSL_get_SSL_CTX'
	Line 678: undefined reference to `SSL_CTX_get_ex_data'
	Line 679: undefined reference to `SSL_get_servername'
	Line 702: undefined reference to `SSL_set_SSL_CTX'
	Line 717: undefined reference to `SSL_get_SSL_CTX'
	Line 718: undefined reference to `SSL_CTX_get_ex_data'
	Line 721: undefined reference to `SSL_ctrl'
	Line 732: undefined reference to `SSL_CTX_callback_ctrl'
	Line 748: undefined reference to `SSL_CTX_callback_ctrl'
	Line 756: undefined reference to `SSL_get_servername'
	Line 831: undefined reference to `OPENSSL_init_ssl'
	Line 836: undefined reference to `OPENSSL_init_crypto'
	Line 837: undefined reference to `OPENSSL_init_ssl'
/luasec/src/x509.c
	Line 143: undefined reference to `OBJ_obj2txt'
	Line 161: undefined reference to `ASN1_STRING_get0_data'
	Line 162: undefined reference to `ASN1_STRING_length'
	Line 165: undefined reference to `ASN1_STRING_to_UTF8'
	Line 168: undefined reference to `CRYPTO_free'
	Line 182: undefined reference to `BIO_s_mem'
	Line 182: undefined reference to `BIO_new'
	Line 183: undefined reference to `ASN1_TIME_print'
	Line 184: undefined reference to `BIO_ctrl'
	Line 186: undefined reference to `BIO_free'
	Line 197: undefined reference to `ASN1_STRING_get0_data'
	Line 198: undefined reference to `ASN1_STRING_length'
	Line 245: undefined reference to `X509_NAME_entry_count'
	Line 247: undefined reference to `X509_NAME_get_entry'
	Line 248: undefined reference to `X509_NAME_ENTRY_get_object'
	Line 254: undefined reference to `X509_NAME_ENTRY_get_data'
	Line 269: undefined reference to `X509_get_subject_name'
	Line 278: undefined reference to `X509_get_issuer_name'
	Line 299: undefined reference to `X509_get_ext_by_NID'
	Line 300: undefined reference to `X509_get_ext'
	Line 303: undefined reference to `X509V3_EXT_d2i'
	Line 308: undefined reference to `X509_EXTENSION_get_object'
	Line 312: undefined reference to `X509_EXTENSION_get_object'
	Line 390: undefined reference to `BIO_s_mem'
	Line 390: undefined reference to `BIO_new'
	Line 391: undefined reference to `PEM_write_bio_X509'
	Line 395: undefined reference to `BIO_ctrl'
	Line 400: undefined reference to `BIO_free'
	Line 413: undefined reference to `BIO_s_mem'
	Line 413: undefined reference to `BIO_new'
	Line 414: undefined reference to `X509_get_pubkey'
	Line 415: undefined reference to `PEM_write_bio_PUBKEY'
	Line 416: undefined reference to `BIO_ctrl'
	Line 419: undefined reference to `EVP_PKEY_base_id'
	Line 436: undefined reference to `EVP_PKEY_bits'
	Line 445: undefined reference to `BIO_free'
	Line 446: undefined reference to `EVP_PKEY_free'
	Line 462: undefined reference to `EVP_sha1'
	Line 465: undefined reference to `EVP_sha1'
	Line 467: undefined reference to `EVP_sha256'
	Line 469: undefined reference to `EVP_sha512'
	Line 476: undefined reference to `X509_digest'
	Line 479: undefined reference to `ERR_get_error'
	Line 479: undefined reference to `ERR_reason_error_string'
	Line 494: undefined reference to `X509_getm_notAfter'
	Line 494: undefined reference to `X509_cmp_time'
	Line 495: undefined reference to `X509_getm_notBefore'
	Line 495: undefined reference to `X509_cmp_time'
	Line 508: undefined reference to `X509_get_serialNumber'
	Line 509: undefined reference to `ASN1_INTEGER_to_BN'
	Line 510: undefined reference to `BN_bn2hex'
	Line 512: undefined reference to `BN_free'
	Line 513: undefined reference to `CRYPTO_free'
	Line 523: undefined reference to `X509_getm_notBefore'
	Line 532: undefined reference to `X509_getm_notAfter'
	Line 561: undefined reference to `X509_STORE_CTX_new'
	Line 562: undefined reference to `X509_STORE_new'
	Line 571: undefined reference to `X509_STORE_add_cert'
	Line 585: undefined reference to `X509_STORE_CTX_init'
	Line 595: undefined reference to `X509_verify_cert'
	Line 596: undefined reference to `X509_STORE_CTX_get_error'
	Line 598: undefined reference to `X509_verify_cert_error_string'
	Line 608: undefined reference to `X509_STORE_CTX_free'
	Line 612: undefined reference to `X509_STORE_free'
	Line 625: undefined reference to `X509_free'
	Line 662: undefined reference to `BIO_s_mem'
	Line 662: undefined reference to `BIO_new'
	Line 664: undefined reference to `BIO_write'
	Line 665: undefined reference to `PEM_read_bio_X509'
	Line 670: undefined reference to `BIO_free'
0 Likes

#2

What other extensions are you using and which version of LuaSec are you using?

1 Like

#3

I’m using like below:

Defold: 1.2.164
Luasec: https://github.com/sonountaleban/defold-luasec/archive/master.zip
(added to game.project & fetched the recent version)

Other extensions:
https://github.com/britzl/defold-luasocket/archive/master.zip,
https://github.com/defold/extension-facebook/archive/master.zip,
https://github.com/defold/android-base-extensions/releases/download/1.0.0/support-v4-27.0.2.zip,
https://github.com/defold/android-base-extensions/releases/download/1.0.0/support-v7-27.0.2.zip,
https://github.com/defold/extension-iap/archive/master.zip

0 Likes

#4

Try my updated version of LuaSec:

1 Like

#5

Ok I’ll try. Thanks.

0 Likes