2
我想鏈接ssl庫到我的編譯命令。我通過鏈接ssl庫
sudo apt-get install libssl-dev
任我compiliaton命令
g++ -Wall -pedantic -std=c++11 -lcrypto -lssl file.cpp
安裝它然而,它抱怨:
:(.text+0x19b): undefined reference to `SSL_library_init'
:(.text+0x1a0): undefined reference to `SSLv23_client_method'
:(.text+0x1a8): undefined reference to `SSL_CTX_new'
:(.text+0x1ff): undefined reference to `SSL_CTX_ctrl'
:(.text+0x20e): undefined reference to `SSL_new'
:(.text+0x26b): undefined reference to `SSL_set_fd'
:(.text+0x2b6): undefined reference to `SSL_get_peer_certificate'
:(.text+0x399): undefined reference to `PEM_write_X509'
:(.text+0x41d): undefined reference to `SSL_write'
(.text+0x511): undefined reference to `SSL_read'
所有來源表明我的鏈接是正確的。我有加密庫相同的問題,但使用安裝命令修復它(似乎我沒有它)
我正在運行的Ubuntu。
你可以張貼整個連接器輸出?它甚至找到你的libssl和libcrypto ?: – Pavel