Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage issue on Ubuntu for windows #31

Closed
imobulus opened this issue Sep 20, 2020 · 2 comments
Closed

Usage issue on Ubuntu for windows #31

imobulus opened this issue Sep 20, 2020 · 2 comments

Comments

@imobulus
Copy link

imobulus commented Sep 20, 2020

Hi,

I need to use telegram database API for automatization purposes, so I installed WSL2 and Ubuntu 20 on my windows PC and then compiled the tdlib package using instructions from TDLib themselves. I installed it in the $HOME/go/src/telegram.org directory, which I created just for this purpose. Then I did go get github.com/zelenin/go-tdlib, pasted example code from README to main.go (in another directory), and did go build.

It resulted in

imobulus@IMOBULUS-LAP:~/go/testing$ go build
# github.com/zelenin/go-tdlib/client
../src/github.com/zelenin/go-tdlib/client/tdlib.go:5:10: fatal error: td/telegram/td_json_client.h: No such file or directory
    5 | #include <td/telegram/td_json_client.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

After some research i found out that this file is located in .../tdlib/include/td/telegram, so i copied the whole td folder in there. Next go build looked like this

imobulus@IMOBULUS-LAP:~/go/testing$ go build
# github.com/zelenin/go-tdlib/client
/usr/bin/ld: cannot find -ltdjson_static
/usr/bin/ld: cannot find -ltdjson_private
/usr/bin/ld: cannot find -ltdclient
/usr/bin/ld: cannot find -ltdcore
/usr/bin/ld: cannot find -ltdactor
/usr/bin/ld: cannot find -ltddb
/usr/bin/ld: cannot find -ltdsqlite
/usr/bin/ld: cannot find -ltdnet
/usr/bin/ld: cannot find -ltdutils
collect2: error: ld returned 1 exit status

I haven't been able to fix this issue so far.

P.S. I tried using tdlib with python wrapper. It worked like a charm, so tdlib is installed correctly.

@rusq
Copy link

rusq commented Dec 12, 2020

I wouldn't think that this is a library problem - "it works on my machine", but I'm not on Windows. I would suggest that this is an environment issue.

I would troubleshot this like that:

  1. Was the make install executed for tdlib ?
  2. Where did it install the libraries? Check if the files are really there
  3. Is this directory in the PATH? If not, add it.
  4. Try to compile.
  5. If step (4) fails, set the LD_LIBRARY_PATH env variable to include the directory from step (2).
  6. Retry step (4)

@PullDakar
Copy link

Hi, @imobulus! I have the same issue. The following steps helped me:

In this manual - "https://tdlib.github.io/td/build.html?language=Go" you must select Linux, Ubuntu ..., checkbox "Install built TDLib to /usr/local instead of placing the files to td/tdlib" and g++ compiler.

P.S. In the described commands there is one: "cmake --build. --target install". Here you may need a "sudo"

@zelenin zelenin closed this as completed Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants