2010-06-03 78 views
0

我正在試圖在我的Mac上構建TorTunnel。我已經成功安裝了Boost庫及其開發文件。 TorTunnel還需要OpenSSL及其開發文件。ld:找不到OpenSSL(libssl)的符號

我已經將它們安裝在/usr/lib/libssl.dylib和/ usr/include/openssl /中。

當我運行make命令,這是錯誤我越來越:

 
g++ -ggdb -g -O2 -lssl -lboost_system-xgcc42-mt-1_38 -o torproxy TorProxy.o HybridEncryption.o Connection.o Cell.o Directory.o ServerListing.o Util.o Circuit.o CellEncrypter.o RelayCellDispatcher.o CellConsumer.o ProxyShuffler.o CreateCell.o CreatedCell.o TorTunnel.o SocksConnection.o Network.o 
Undefined symbols: 
    "_BN_hex2bn", referenced from: 
     Circuit::initializeDhParameters()  in Circuit.o 
    "_BN_free", referenced from: 
     Circuit::~Circuit()in Circuit.o 
     Circuit::~Circuit()in Circuit.o 
     CreatedCell::getKeyMaterial(unsigned char**, unsigned char**)in CreatedCell.o 
    "_DH_generate_key", referenced from: 
     Circuit::initializeDhParameters()  in Circuit.o 
    "_PEM_read_bio_RSAPublicKey", referenced from: 
     ServerListing::getOnionKey()  in ServerListing.o 
    "_BIO_s_mem", referenced from: 
     Connection::initializeSSL()  in Connection.o 
     Connection::initializeSSL()  in Connection.o 
    "_DH_free", referenced from: 
     Circuit::~Circuit()in Circuit.o 
    "_BIO_ctrl_pending", referenced from: 
     Connection::writeFromBuffer(boost::function)in Connection.o 
    "_RSA_size", referenced from: 
     HybridEncryption::encryptInSingleChunk(unsigned char*, int, unsigned char**, int*, rsa_st*)in HybridEncryption.o 
     HybridEncryption::encryptInHybridChunk(unsigned char*, int, unsigned char**, int*, rsa_st*)in HybridEncryption.o 
     HybridEncryption::encrypt(unsigned char*, int, unsigned char**, int*, rsa_st*)in HybridEncryption.o 
    "_RSA_public_encrypt", referenced from: 
     HybridEncryption::encryptInSingleChunk(unsigned char*, int, unsigned char**, int*, rsa_st*)in HybridEncryption.o 
     HybridEncryption::encryptInHybridChunk(unsigned char*, int, unsigned char**, int*, rsa_st*)in HybridEncryption.o 
    "_BN_num_bits", referenced from: 
     CreateCell::CreateCell(unsigned short, dh_st*, rsa_st*)in CreateCell.o 
     CreatedCell::getKeyMaterial(unsigned char**, unsigned char**)in CreatedCell.o 
     CreatedCell::getKeyMaterial(unsigned char**, unsigned char**)in CreatedCell.o 
     CreatedCell::isValid()  in CreatedCell.o 
    "_SHA1", referenced from: 
     CellEncrypter::expandKeyMaterial(unsigned char*, int, unsigned char*, int)in CellEncrypter.o 
    "_BN_bn2bin", referenced from: 
     CreateCell::CreateCell(unsigned short, dh_st*, rsa_st*)in CreateCell.o 
    "_BN_bin2bn", referenced from: 
     CreatedCell::getKeyMaterial(unsigned char**, unsigned char**)in CreatedCell.o 
    "_DH_compute_key", referenced from: 
     CreatedCell::getKeyMaterial(unsigned char**, unsigned char**)in CreatedCell.o 
    "_BIO_new", referenced from: 
     Connection::initializeSSL()  in Connection.o 
     Connection::initializeSSL()  in Connection.o 
    "_BIO_new_mem_buf", referenced from: 
     ServerListing::getOnionKey()  in ServerListing.o 
    "_AES_ctr128_encrypt", referenced from: 
     HybridEncryption::AES_encrypt(unsigned char*, int, unsigned char*, unsigned char*, int)in HybridEncryption.o 
     CellEncrypter::aesOperate(Cell&, aes_key_st*, unsigned char*, unsigned char*, unsigned int*)in CellEncrypter.o 
    "_BIO_read", referenced from: 
     Connection::writeFromBuffer(boost::function)in Connection.o 
    "_SHA1_Update", referenced from: 
     CellEncrypter::calculateDigest(SHAstate_st*, RelayCell&, unsigned char*)in CellEncrypter.o 
     CellEncrypter::initKeyMaterial(unsigned char*)in CellEncrypter.o 
     CellEncrypter::initKeyMaterial(unsigned char*)in CellEncrypter.o 
    "_SHA1_Final", referenced from: 
     CellEncrypter::calculateDigest(SHAstate_st*, RelayCell&, unsigned char*)in CellEncrypter.o 
    "_DH_size", referenced from: 
     CreatedCell::getKeyMaterial(unsigned char**, unsigned char**)in CreatedCell.o 
    "_DH_new", referenced from: 
     Circuit::initializeDhParameters()  in Circuit.o 
    "_BIO_write", referenced from: 
     Connection::readIntoBufferComplete(boost::function, boost::system::error_code const&, unsigned long)in Connection.o 
    "_RSA_free", referenced from: 
     Circuit::~Circuit()in Circuit.o 
    "_BN_dup", referenced from: 
     Circuit::initializeDhParameters()  in Circuit.o 
     Circuit::initializeDhParameters()  in Circuit.o 
    "_BN_new", referenced from: 
     Circuit::initializeDhParameters()  in Circuit.o 
     Circuit::initializeDhParameters()  in Circuit.o 
    "_SHA1_Init", referenced from: 
     CellEncrypter::CellEncrypter()in CellEncrypter.o 
     CellEncrypter::CellEncrypter()in CellEncrypter.o 
    "_RAND_bytes", referenced from: 
     HybridEncryption::encryptInHybridChunk(unsigned char*, int, unsigned char**, int*, rsa_st*)in HybridEncryption.o 
     Util::getRandomId()  in Util.o 
    "_AES_set_encrypt_key", referenced from: 
     HybridEncryption::AES_encrypt(unsigned char*, int, unsigned char*, unsigned char*, int)in HybridEncryption.o 
     CellEncrypter::initKeyMaterial(unsigned char*)in CellEncrypter.o 
     CellEncrypter::initKeyMaterial(unsigned char*)in CellEncrypter.o 
    "_BN_set_word", referenced from: 
     Circuit::initializeDhParameters()  in Circuit.o 
    "_RSA_new", referenced from: 
     ServerListing::getOnionKey()  in ServerListing.o 
ld: symbol(s) not found 
collect2: ld returned 1 exit status 
make: *** [torproxy] Error 1 

任何想法,我怎麼能解決這個問題?

回答

4

您還需要libcrypto。

更改您的鏈接線:

g++ -ggdb -g -O2 -lssl -lcrypt ... as before ... 
1

至少在丟失的符號是不是libcrypto的的libssl的一部分,但一部分:

diciu:~ diciu$ nm /usr/lib/libcrypto.dylib | grep PEM_read_bio_RSAPublicKey 
00031d20 T _PEM_read_bio_RSAPublicKey 

添加「-lcrypto」你的編譯行。

1

如果libcrypto已安裝在/ opt/local/lib中,請將-lcrypt標誌更改爲-lcrypto標誌。

g++ -ggdb -g -O2 -L/opt/local/lib -L/usr/lib -lssl -lcrypto -lboost_system-mt