go-tdlib icon indicating copy to clipboard operation
go-tdlib copied to clipboard

How to use with go modules?

Open un000 opened this issue 5 years ago • 7 comments

Got this error:

../../../../pkg/mod/github.com/!arman92/[email protected]/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.

un000 avatar Aug 19 '19 22:08 un000

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?

Arman92 avatar Aug 21 '19 05:08 Arman92

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

un000 avatar Aug 21 '19 17:08 un000

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

  • [x] Install built TDLib to /usr/local instead of placing the files to td/tdlib.**

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.

Arman92 avatar Aug 24 '19 03:08 Arman92

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

aloska avatar Mar 20 '21 03:03 aloska

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

Arman92 avatar Mar 25 '21 14:03 Arman92

@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

Touexe avatar May 06 '21 02:05 Touexe

我也遇到了相同的问题

BigCatGit avatar May 23 '22 17:05 BigCatGit