Arman92 / go-tdlib

Golang Telegram TdLib JSON bindings
GNU General Public License v3.0
436 stars 100 forks source link

Problem building example #13

Closed azaz5959 closed 5 years ago

azaz5959 commented 5 years ago

I'm using Ubuntu 16.04 and use instruction for installing library on Ubuntu. When I want to build the provided example I got the following errors:

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdsqlite.a(sqlite3.c.o): In function `sqlcipher_openssl_hmac':
sqlite3.c:(.text.sqlcipher_openssl_hmac+0x38): undefined reference to `HMAC_CTX_new'
sqlite3.c:(.text.sqlcipher_openssl_hmac+0x96): undefined reference to `HMAC_CTX_free'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdsqlite.a(sqlite3.c.o): In function `sqlcipher_openssl_activate':
sqlite3.c:(.text.sqlcipher_openssl_activate+0xa4): undefined reference to `OPENSSL_init_crypto'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdsqlite.a(sqlite3.c.o): In function `sqlcipher_openssl_ctx_init':
sqlite3.c:(.text.sqlcipher_openssl_ctx_init+0xbc): undefined reference to `OPENSSL_init_crypto'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdclient.a(Client.cpp.o): In function `std::thread::_State_impl<std::thread::_Invoker<std::tuple<td::detail::ThreadStl::ThreadStl<td::Client::Impl::init()::{lambda()#1}>(td::Client::Impl::init()::{lambda()#1}&&)::{lambda()#1}> > >::~_State_impl()':
Client.cpp:(.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN2td6detail9ThreadStlC4IZNS3_6Client4Impl4initEvEUlvE_JEEEOT_DpOT0_EUlvE_EEEEED0Ev[_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN2td6detail9ThreadStlC4IZNS3_6Client4Impl4initEvEUlvE_JEEEOT_DpOT0_EUlvE_EEEEED5Ev]+0x38): undefined reference to `std::thread::_State::~_State()'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdclient.a(Client.cpp.o): In function `std::thread::_State_impl<std::thread::_Invoker<std::tuple<td::detail::ThreadStl::ThreadStl<td::Client::Impl::init()::{lambda()#1}>(td::Client::Impl::init()::{lambda()#1}&&)::{lambda()#1}> > >::~_State_impl()':
Client.cpp:(.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN2td6detail9ThreadStlC4IZNS3_6Client4Impl4initEvEUlvE_JEEEOT_DpOT0_EUlvE_EEEEED2Ev[_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN2td6detail9ThreadStlC4IZNS3_6Client4Impl4initEvEUlvE_JEEEOT_DpOT0_EUlvE_EEEEED5Ev]+0x3a): undefined reference to `std::thread::_State::~_State()'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdclient.a(Client.cpp.o): In function `td::Client::Client()':
Client.cpp:(.text._ZN2td6ClientC2Ev+0x406): undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdcore.a(crypto.cpp.o): In function `td::RSA::from_pem(td::Slice)':
crypto.cpp:(.text._ZN2td3RSA8from_pemENS_5SliceE+0x6d0): undefined reference to `RSA_get0_key'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdactor.a(ConcurrentScheduler.cpp.o): In function `std::thread::_State_impl<std::thread::_Invoker<std::tuple<td::detail::ThreadStl::ThreadStl<td::ConcurrentScheduler::start()::{lambda()#1}>(td::ConcurrentScheduler::start()::{lambda()#1}&&)::{lambda()#1}> > >::~_State_impl()':
ConcurrentScheduler.cpp:(.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN2td6detail9ThreadStlC4IZNS3_19ConcurrentScheduler5startEvEUlvE_JEEEOT_DpOT0_EUlvE_EEEEED2Ev+0x10): undefined reference to `std::thread::_State::~_State()'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdactor.a(ConcurrentScheduler.cpp.o): In function `std::thread::_State_impl<std::thread::_Invoker<std::tuple<td::detail::ThreadStl::ThreadStl<td::ConcurrentScheduler::start()::{lambda()#1}>(td::ConcurrentScheduler::start()::{lambda()#1}&&)::{lambda()#1}> > >::~_State_impl()':
ConcurrentScheduler.cpp:(.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN2td6detail9ThreadStlC4IZNS3_19ConcurrentScheduler5startEvEUlvE_JEEEOT_DpOT0_EUlvE_EEEEED0Ev+0x17): undefined reference to `std::thread::_State::~_State()'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdactor.a(ConcurrentScheduler.cpp.o): In function `td::ConcurrentScheduler::start()':
ConcurrentScheduler.cpp:(.text._ZN2td19ConcurrentScheduler5startEv+0x11f): undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdnet.a(SslStream.cpp.o): In function `td::detail::(anonymous namespace)::strm_create(bio_st*)':
SslStream.cpp:(.text._ZN2td6detail12_GLOBAL__N_111strm_createEP6bio_st[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0xa): undefined reference to `BIO_set_init'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdnet.a(SslStream.cpp.o): In function `td::LambdaGuard<td::detail::SslStreamImpl::init(td::CSlice, td::CSlice, td::SslStream::VerifyPeer)::{lambda()#3}>::~LambdaGuard()':
SslStream.cpp:(.text._ZN2td11LambdaGuardIZNS_6detail13SslStreamImpl4initENS_6CSliceES3_NS_9SslStream10VerifyPeerEEUlvE1_ED2Ev[_ZN2td11LambdaGuardIZNS_6detail13SslStreamImpl4initENS_6CSliceES3_NS_9SslStream10VerifyPeerEEUlvE1_ED5Ev]+0x35): undefined reference to `SSL_is_init_finished'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdnet.a(SslStream.cpp.o): In function `td::LambdaGuard<td::detail::SslStreamImpl::init(td::CSlice, td::CSlice, td::SslStream::VerifyPeer)::{lambda()#3}>::~LambdaGuard()':
SslStream.cpp:(.text._ZN2td11LambdaGuardIZNS_6detail13SslStreamImpl4initENS_6CSliceES3_NS_9SslStream10VerifyPeerEEUlvE1_ED0Ev[_ZN2td11LambdaGuardIZNS_6detail13SslStreamImpl4initENS_6CSliceES3_NS_9SslStream10VerifyPeerEEUlvE1_ED5Ev]+0x3b): undefined reference to `SSL_is_init_finished'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdnet.a(SslStream.cpp.o): In function `td::detail::SslStreamImpl::init(td::CSlice, td::CSlice, td::SslStream::VerifyPeer)':
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x7e): undefined reference to `TLS_client_method'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0xa8): undefined reference to `SSL_CTX_set_options'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x37d): undefined reference to `OPENSSL_init_ssl'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x451): undefined reference to `BIO_set_data'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x635): undefined reference to `BIO_get_new_index'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x643): undefined reference to `BIO_meth_new'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x659): undefined reference to `BIO_meth_set_write'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x66f): undefined reference to `BIO_meth_set_read'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x685): undefined reference to `BIO_meth_set_create'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x69b): undefined reference to `BIO_meth_set_destroy'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x6b1): undefined reference to `BIO_meth_set_ctrl'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdnet.a(SslStream.cpp.o): In function `td::detail::SslStreamImpl::~SslStreamImpl()':
SslStream.cpp:(.text._ZN2td6detail13SslStreamImplD2Ev[_ZN2td6detail13SslStreamImplD5Ev]+0x50): undefined reference to `SSL_is_init_finished'
SslStream.cpp:(.text._ZN2td6detail13SslStreamImplD2Ev[_ZN2td6detail13SslStreamImplD5Ev]+0x1ca): undefined reference to `SSL_is_init_finished'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdnet.a(SslStream.cpp.o): In function `td::detail::(anonymous namespace)::strm_read(bio_st*, char*, int)':
SslStream.cpp:(.text._ZN2td6detail12_GLOBAL__N_19strm_readEP6bio_stPci[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x30): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdnet.a(SslStream.cpp.o): In function `td::detail::(anonymous namespace)::strm_write(bio_st*, char const*, int)':
SslStream.cpp:(.text._ZN2td6detail12_GLOBAL__N_110strm_writeEP6bio_stPKci[_ZN2td6detail13SslStreamImpl4initENS_6CSliceES2_NS_9SslStream10VerifyPeerE]+0x2d): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdutils.a(BigNum.cpp.o): In function `td::BigNum::ensure_const_time()':
BigNum.cpp:(.text._ZN2td6BigNum17ensure_const_timeEv+0x11): undefined reference to `BN_set_flags'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libtdutils.a(crypto.cpp.o): In function `td::init_crypto()':
crypto.cpp:(.text._ZN2td11init_cryptoEv+0xc9): undefined reference to `OPENSSL_init_crypto'
collect2: error: ld returned 1 exit status
Arman92 commented 5 years ago

Seems like you didn't install the OpenSSL library

Arman92 commented 5 years ago

Closing this issue for inactivity.