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

gcc and tdlib build on windows ( instruction ) #106

Open
Zoha opened this issue Oct 19, 2022 · 1 comment
Open

gcc and tdlib build on windows ( instruction ) #106

Zoha opened this issue Oct 19, 2022 · 1 comment

Comments

@Zoha
Copy link

Zoha commented Oct 19, 2022

for building and executing on windows it can be a little bit tricky, so I'll post my solution for anyone that wants to run it on windows

step 1: building the tdlib

first, install visual studio and build the binaries using this instruction

build instruction

if you had any problem in building the tdlib library it can be for one of the below reasons

  • wrong visual studio components were installed
  • you need a proxy for downloading the dependencies (especially for Iranians)

then copy the directory ( the whole tdlib directory ) into the same drive that you want to execute your app, dont need to be in the exact directory just on the same drive

step 2: Installing GCC

install msys64 for MinGW and GCC

set a new path environment to point to MinGW and its bins
note replace it with your bin folder ( default is this )
C:\msys64\mingw64\bin

step 3: set needed environment variables

set this environment variables

CGO_CFLAGS
-IC:\td\tdlib\include

CGO_LDFLAGS
-LC:\td\tdlib\bin -ltdjson

replace C:\td with your td installation path

then set td path built bins to your environment paths

C:\td\tdlib\bin

again replace the path with your build directory

after that, you can execute your app and use the go-tdlib library

@Zoha Zoha changed the title build and gcc on windows ( instruction ) gcc and tdlib build on windows ( instruction ) Oct 19, 2022
@WCY-dt
Copy link

WCY-dt commented May 14, 2024

The command cmake -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DCMAKE_TOOLCHAIN_FILE:FILEPATH=../vcpkg/scripts/buildsystems/vcpkg.cmake .. in build instruction should be added with -G "Visual Studio 17 2022", specifically the parameters should be queried on CMake Generator according to your version of Visual Studio.

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

2 participants