#mqtt #mosquitto #libmosquitto
#mqtt #mosquitto #libmosquitto
Вопрос:
Я использую cmake для создания файла проекта Visual Studio и открытия проекта в Visual Studio 2015.
Я пытаюсь скомпилировать libmosquitto с Visual studio 2015 C , но я получил эти ошибки.
Я уже включил папку include в OpenSSL win32, но все равно произошел сбой.
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol __imp___vsnprintf libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libMSVCRTD.lib(vsnprintf.obj) 1
Error LNK2019 unresolved external symbol __imp__vsnprintf referenced in function __mosquitto_log_printf libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2liblogging_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__vsnprintf libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libMSVCRTD.lib(vsnprintf.obj) 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_lock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libthread_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_lock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libutil_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_lock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libread_handle.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_lock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libread_handle_client.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_lock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libread_handle_shared.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_lock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libsocks_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_lock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2liblogging_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_lock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmessages_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_lock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_lock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_unlock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libthread_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_unlock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libutil_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_unlock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libread_handle.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_unlock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libread_handle_client.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_unlock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libread_handle_shared.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_unlock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libsocks_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_unlock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2liblogging_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_unlock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmessages_mosq.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_unlock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_mutex_unlock libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_free referenced in function __mosquitto_destroy libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2001 unresolved external symbol _SSL_CTX_free libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_pending referenced in function _mosquitto_loop libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2019 unresolved external symbol _SSL_free referenced in function __mosquitto_destroy libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2001 unresolved external symbol _SSL_free libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol __imp__pthread_equal referenced in function __mosquitto_destroy libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2019 unresolved external symbol __imp__pthread_join referenced in function __mosquitto_destroy libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_join libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libthread_mosq.obj 1
Error LNK2019 unresolved external symbol __imp__pthread_self referenced in function _mosquitto_new libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_self libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libthread_mosq.obj 1
Error LNK2019 unresolved external symbol __imp__pthread_cancel referenced in function __mosquitto_destroy libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2001 unresolved external symbol __imp__pthread_cancel libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libthread_mosq.obj 1
Error LNK2019 unresolved external symbol __imp__pthread_mutex_init referenced in function _mosquitto_reinitialise libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2019 unresolved external symbol __imp__pthread_mutex_destroy referenced in function __mosquitto_destroy libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libmosquitto.obj 1
Error LNK2019 unresolved external symbol _CRYPTO_cleanup_all_ex_data referenced in function __mosquitto_net_cleanup libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _BIO_new_socket referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _CONF_modules_unload referenced in function __mosquitto_net_cleanup libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _ERR_get_error referenced in function __mosquitto_net_read libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _ERR_error_string referenced in function __mosquitto_net_read libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _ERR_free_strings referenced in function __mosquitto_net_cleanup libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _ERR_remove_state referenced in function __mosquitto_net_cleanup libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _OPENSSL_add_all_algorithms_noconf referenced in function __mosquitto_net_init libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _EVP_cleanup referenced in function __mosquitto_net_cleanup libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _ENGINE_cleanup referenced in function __mosquitto_net_cleanup libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_set_psk_client_callback referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_set_cipher_list referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_new referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_set_bio referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_use_PrivateKey_file referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_use_certificate_chain_file referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_load_error_strings referenced in function __mosquitto_net_init libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_set_verify referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_set_default_passwd_cb referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_set_default_passwd_cb_userdata referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_check_private_key referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_new referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_connect referenced in function _mosquitto__socket_connect_tls libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_read referenced in function __mosquitto_net_read libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_write referenced in function __mosquitto_net_write libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_ctrl referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_get_error referenced in function __mosquitto_net_read libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _TLSv1_client_method referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _TLSv1_1_client_method referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _TLSv1_2_client_method referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_shutdown referenced in function __mosquitto_socket_close libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_library_init referenced in function __mosquitto_net_init libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_CTX_load_verify_locations referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_set_ex_data referenced in function __mosquitto_socket_connect libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_get_ex_data referenced in function _psk_client_callback libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2001 unresolved external symbol _SSL_get_ex_data libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_get_ex_new_index referenced in function __mosquitto_net_init libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol _snprintf referenced in function _psk_client_callback libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libnet_mosq.obj 1
Error LNK2019 unresolved external symbol __imp__pthread_create referenced in function _mosquitto_loop_start libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libthread_mosq.obj 1
Error LNK2019 unresolved external symbol _sk_num referenced in function __mosquitto_verify_certificate_hostname libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _sk_value referenced in function __mosquitto_verify_certificate_hostname libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _sk_pop_free referenced in function __mosquitto_verify_certificate_hostname libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _ASN1_STRING_data referenced in function __mosquitto_verify_certificate_hostname libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _X509_STORE_CTX_get_ex_data referenced in function __mosquitto_server_certificate_verify libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _X509_STORE_CTX_get_error_depth referenced in function __mosquitto_server_certificate_verify libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _X509_STORE_CTX_get_current_cert referenced in function __mosquitto_server_certificate_verify libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _X509_get_subject_name referenced in function __mosquitto_verify_certificate_hostname libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _X509_NAME_get_text_by_NID referenced in function __mosquitto_verify_certificate_hostname libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _X509_get_ext_d2i referenced in function __mosquitto_verify_certificate_hostname libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _GENERAL_NAME_free referenced in function __mosquitto_verify_certificate_hostname libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _SSL_get_ex_data_X509_STORE_CTX_idx referenced in function __mosquitto_server_certificate_verify libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libtls_mosq.obj 1
Error LNK2019 unresolved external symbol _BN_num_bits referenced in function __mosquitto_hex2bin libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libutil_mosq.obj 1
Error LNK2019 unresolved external symbol _BN_bn2bin referenced in function __mosquitto_hex2bin libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libutil_mosq.obj 1
Error LNK2019 unresolved external symbol _BN_free referenced in function __mosquitto_hex2bin libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libutil_mosq.obj 1
Error LNK2019 unresolved external symbol _BN_hex2bn referenced in function __mosquitto_hex2bin libmosquitto C:UsersKennethHuJavaWorkspacemosquitto2libutil_mosq.obj 1
Ответ №1:
Я решаю большинство ошибок. Это связано с тем, что x86 несовместим с x64. Я заменяю x64 libeay32MD.lib и ssleay32MD.lib на x86.