GithubHelp home page GithubHelp logo

Comments (10)

levlam avatar levlam commented on May 1, 2024 4

Could you try to disable LTO by commenting line 26 of CMakeLists.txt:

#    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CXX_FLAGS_IPO}")

from td.

arseny30 avatar arseny30 commented on May 1, 2024

Which c++ compiler do you use? And which Linux?

from td.

skeledrew avatar skeledrew commented on May 1, 2024

@arseny30 I used cmake and am on Kubuntu 16.04.

These are all the commands I ran to get to that point:

brew install cmake
brew install gperf
brew install zlib
git clone https://github.com/tdlib/td.git
cd td
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

cmake version is 3.10.2

from td.

skeledrew avatar skeledrew commented on May 1, 2024

@levlam that fixed it, thanks!

I'm now having another problem though trying to use it in Python:

>>> tdjson = ctypes.CDLL('/home/skeledrew/Projects/Telegram/td/build/libtdjson.so')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/skeledrew/.pyenv/versions/3.6.1/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/skeledrew/.linuxbrew/Cellar/openssl/1.0.2n_1/lib/libssl.so.1.0.0: undefined symbol: EVP_idea_cbc
/home/skeledrew/.linuxbrew/Cellar/openssl/1.0.2n_1/lib/libssl.so.1.0.0: undefined symbol: EVP_idea_cbc

Also tg_cli runs but isn't really helpful as to how to provide the id and hash:
[ 1][t 0][1518030714.069893360][cli.cpp:3002] You should provide some valid api_id and api_hash

from td.

levlam avatar levlam commented on May 1, 2024

It looks like libcrypto.so can't be found in runtime when python example is run.

tg_cli is our test console client. You can look here for some examples of TDLib usage in C++, but shouldn't really need it. api_id and api_hash are Application identifier/hash which are needed to access Telegram API and should be obtained at https://my.telegram.org.

from td.

skeledrew avatar skeledrew commented on May 1, 2024

Seems I need to recompile Python. I tried it in default Python2 and it works. Now I just need to figure how to recompile with libcrypto or openssl headers?

>>> tdjson = ctypes.CDLL('/home/skeledrew/Projects/Telegram/td/build/libtdjson.so')
>>> tdjson.__dict__
{'_FuncPtr': <class 'ctypes._FuncPtr'>, '_handle': 30084432, '_name': '/home/skeledrew/Projects/Telegram/td/build/libtdjson.so'}
>>> tdjc = tdjson.td_json_client_create
>>> tdjc
<_FuncPtr object at 0x7f5658758ef0>
>>> tdjc()
30008816
>>> [ 3][t 4][1518046401.150130272][Td.cpp:4296][!Td][&td_requests]     Sending update: updateAuthorizationState {
  authorization_state = authorizationStateWaitTdlibParameters {
  }
} 

BTW I already have an id and hash, as I've been using Telethon for some time now. It's just that doing tg_cli <id> <hash> or tg_cli api_id=<id> api_hash=<hash> doesn't work. Thanks again.

from td.

levlam avatar levlam commented on May 1, 2024

libcrypto should be already compiled, libssl can't be shipped without libcrypto, so you just need to find it.

Parameters are accepted by tg_cli in the usual way:

tg_cli --api_id <api_id> --api_hash <api_hash>

from td.

snj33v avatar snj33v commented on May 1, 2024

any reason why when enabling LTO, build fails
I'm running on stable debian system

from td.

levlam avatar levlam commented on May 1, 2024

LTO requires a lot of support from build tools. LTO greatly improves performance and executable size when it succeeds, but it is very likely to fail, because some of the build tools isn't aware of LTO or has an incompatible version. It is hard to find an exact reason of failure remotely.

from td.

levlam avatar levlam commented on May 1, 2024

LTO is disabled by default in TDLib 1.2.0, so there should be no more build issues.

from td.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.