From f7e27c9acdfd96c6a5d7f3e056643a722945cd96 Mon Sep 17 00:00:00 2001 From: llnulldisk <48621230+llnulldisk@users.noreply.github.com> Date: Tue, 20 Sep 2022 19:12:40 +0200 Subject: Add docs for installing on windows --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.md b/README.md index d3aeb69..99e1ce8 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,57 @@ You can treat this repository as a submodule of your project, for example, see [ You can use Docker to build and run your bot. Set the base image of your's Dockerfile to [reo7sp/tgbot-cpp](https://hub.docker.com/r/reo7sp/tgbot-cpp/). +## Installation Windows + +### Download vcpkg and tgbot-cpp + +Taken from [Vcpkg - Quick Start: Windows](https://github.com/Microsoft/vcpkg/#quick-start-windows): + +Prerequisites: +- Windows 7 or newer +- Git +- Visual Studio 2015 Update 3 or greater with the English language pack + +First, download and bootstrap vcpkg itself; it can be installed anywhere, +but generally we recommend using vcpkg as a submodule for CMake projects, +and installing it globally for Visual Studio projects. +We recommend somewhere like `C:\src\vcpkg` or `C:\dev\vcpkg`, +since otherwise you may run into path issues for some port build systems. + +```cmd +> git clone https://github.com/microsoft/vcpkg +> .\vcpkg\bootstrap-vcpkg.bat +``` + +In order to use vcpkg with Visual Studio, +run the following command (may require administrator elevation): + +```cmd +> .\vcpkg\vcpkg integrate install +``` + +To install the libraries for Windows x64, run: + +```cmd +> .\vcpkg\vcpkg install tgbot-cpp:x64-windows +``` + +To install for Windows x86, run: + +```cmd +> .\vcpkg\vcpkg install tgbot-cpp +``` + +The library will now be installed and Visual Studio should be able to find the vcpkg installation. + +### Setup project with CMakeLists + +Use the [example CMakeLists.txt](samples/echobot/CMakeLists.txt) with changes: + +Remove `/usr/local/include` + +Change `/usr/local/lib/libTgBot.a` to `C:/src/vcpkg/installed/x64-windows/lib/TgBot.lib` or something simmilar according to your own installation path. + ## Bot compilation -- cgit v1.2.3