1

我在 Xcode 中有一个简单的项目——它实际上还没有做任何事情,只包括boost::asio::ssl

// main.cpp

#include <iostream>
#include <string>
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>

using namespace std ;

int main (int argc, const char * argv [] ) {
    return 0 ;
}

我将它与libssl.dyliband链接,libboost_system.dylib并在构建时得到它:

Undefined symbols for architecture x86_64:
  "_CONF_modules_unload", referenced from:
      boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in main.o
  "_CRYPTO_cleanup_all_ex_data", referenced from:
      boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in main.o
  "_CRYPTO_num_locks", referenced from:
      boost::asio::ssl::detail::openssl_init_base::do_init::do_init() in main.o
  "_CRYPTO_set_id_callback", referenced from:
      boost::asio::ssl::detail::openssl_init_base::do_init::do_init() in main.o
      boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in main.o
  "_CRYPTO_set_locking_callback", referenced from:
      boost::asio::ssl::detail::openssl_init_base::do_init::do_init() in main.o
      boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in main.o
  "_ENGINE_cleanup", referenced from:
      boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in main.o
  "_ERR_free_strings", referenced from:
      boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in main.o
  "_ERR_reason_error_string", referenced from:
      boost::asio::error::detail::ssl_category::message(int) const in main.o
  "_ERR_remove_state", referenced from:
      boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in main.o
  "_EVP_cleanup", referenced from:
      boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in main.o
  "_OPENSSL_add_all_algorithms_noconf", referenced from:
      boost::asio::ssl::detail::openssl_init_base::do_init::do_init() in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

是否还有其他一些我遗漏的图书馆或其他我忽略的东西?

4

1 回答 1

5

我认为您还需要链接 libcrypto-lcrypto

于 2012-08-01T04:26:59.447 回答