Version 5.0.3.
[tdesktop.git] / docs / building-win-x64.md
bloba85ce116fe937ee1f79ac6136e0edda0889b2731
1 # Build instructions for Windows 64-bit
3 - [Prepare folder](#prepare-folder)
4 - [Install third party software](#install-third-party-software)
5 - [Clone source code and prepare libraries](#clone-source-code-and-prepare-libraries)
6 - [Build the project](#build-the-project)
7 - [Qt Visual Studio Tools](#qt-visual-studio-tools)
9 ## Prepare folder
11 The build is done in **Visual Studio 2022** with **10.0.22000.0** SDK version.
13 Choose an empty folder for the future build, for example **D:\\TBuild**. It will be named ***BuildPath*** in the rest of this document. Create two folders there, ***BuildPath*\\ThirdParty** and ***BuildPath*\\Libraries**.
15 All commands (if not stated otherwise) will be launched from **x64 Native Tools Command Prompt for VS 2022.bat** (should be in **Start Menu > Visual Studio 2022** menu folder). Pay attention not to use any other Command Prompt.
17 ### Obtain your API credentials
19 You will require **api_id** and **api_hash** to access the Telegram API servers. To learn how to obtain them [click here][api_credentials].
21 ## Install third party software
23 * Download **Python 3.10** installer from [https://www.python.org/downloads/](https://www.python.org/downloads/) and install it with adding to PATH.
24 * Download **CMake 3.21 or later** installer from [https://cmake.org/download/](https://cmake.org/download/) and install it.
25 * Download **Git** installer from [https://git-scm.com/download/win](https://git-scm.com/download/win) and install it.
27 ## Clone source code and prepare libraries
29 Open **x64 Native Tools Command Prompt for VS 2022.bat**, go to ***BuildPath*** and run
31     git clone --recursive https://github.com/telegramdesktop/tdesktop.git
32     tdesktop\Telegram\build\prepare\win.bat
34 ## Build the project
36 Go to ***BuildPath*\\tdesktop\\Telegram** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
38     configure.bat x64 -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_HASH
40 * Open ***BuildPath*\\tdesktop\\out\\Telegram.sln** in Visual Studio 2022
41 * Select Telegram project and press Build > Build Telegram (Debug and Release configurations)
42 * The result Telegram.exe will be located in **D:\TBuild\tdesktop\out\Debug** (and **Release**)
44 ### Qt Visual Studio Tools
46 For better debugging you may want to install Qt Visual Studio Tools:
48 * Open **Extensions** -> **Manage Extensions**
49 * Go to **Online** tab
50 * Search for **Qt**
51 * Install **Qt Visual Studio Tools** extension
53 [api_credentials]: api_credentials.md