Arman92 / go-tdlib

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

How to use with go modules? #25

Open un000 opened 5 years ago

un000 commented 5 years ago

Got this error:

../../../../pkg/mod/github.com/!arman92/go-tdlib@v0.0.0-20190517084650-5bbe270b752e/tdlib.go:10:10: fatal error: 'td/telegram/td_json_client.h' file not found
#include <td/telegram/td_json_client.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Arman92 commented 5 years ago

Haven't tested with go modules, but above error seems to be related to missing tdlib in your include paths. What OS are you using? Did you follow the tdlib building instructions?

un000 commented 5 years ago

Yes, I did, how to include tdlib, so? I use Os X

Arman92 commented 5 years ago

You might want to check out this build instruction: https://tdlib.github.io/td/build.html?language=Go If you check the below option:

then by following the instructions (cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ..) you'll have compiled tdlib (including headers) copied to your system-wide paths.

aloska commented 3 years ago

Hello I use all instructions to build and isnstall tdlib in windows 10. And it build and install success. But have error when build my go program:

fatal error: td/telegram/td_json_client.h: No such file or directory //#include <td/telegram/td_json_client.h>

I tried to add to system Path variable path to \td\tdlib\ and to \td - but same error Which path should be in system variable? Thanks

Arman92 commented 3 years ago

Hello I use all instructions to build and isnstall tdlib in windows 10. And it build and install success. But have error when build my go program:

fatal error: td/telegram/td_json_client.h: No such file or directory //#include <td/telegram/td_json_client.h>

I tried to add to system Path variable path to \td\tdlib\ and to \td - but same error Which path should be in system variable? Thanks

Are you sure you followed the bellow instructions? https://github.com/Arman92/go-tdlib/issues/25#issuecomment-524515410

Touexe commented 3 years ago

@Arman92 i've followed all instruction from https://tdlib.github.io/td/build.html?language=Go for windows OS, i still got the same Error as @aloska

BigCatGit commented 2 years ago

我也遇到了相同的问题