You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation is located [here](http://reo7sp.github.io/tgbot-cpp).
10
8
@@ -17,6 +15,7 @@ Documentation is located [here](http://reo7sp.github.io/tgbot-cpp).
17
15
## Sample
18
16
19
17
Simple echo bot which sends everything it receives:
18
+
20
19
```cpp
21
20
#include<stdio.h>
22
21
#include<tgbot/tgbot.h>
@@ -52,15 +51,24 @@ All other samples are located [here](samples).
52
51
53
52
## Dependencies
54
53
55
-
Firstly you need to install some dependencies such as Boost and build tools such as CMake. On Debian-based distibutives you can do it with these commands:
54
+
Dependencies:
55
+
- CMake
56
+
- Boost
57
+
- OpenSSL
58
+
- ZLib
59
+
- Libcurl (optional unless you want to use curl-based http client `CurlHttpClient`).
60
+
61
+
62
+
## Library installation on Linux
63
+
64
+
You can install dependencies on Debian-based distibutives with these commands:
65
+
56
66
```sh
57
-
sudo apt-get install g++ make binutils cmake libssl-dev libboost-system-dev zlib1g-dev
If you want to use curl-based http client `CurlHttpClient`, you also need to install `libcurl4-openssl-dev` package.
60
69
61
-
## Library installation
70
+
You can compile and install the library with these commands:
62
71
63
-
If you want to install the library system-wide:
64
72
```sh
65
73
git clone https://github.com/reo7sp/tgbot-cpp
66
74
cd tgbot-cpp
@@ -69,34 +77,39 @@ make -j4
69
77
sudo make install
70
78
```
71
79
72
-
You can treat this repository as a submodule of your project, for example, see [echobot-submodule](samples/echobot-submodule/CMakeLists.txt)
80
+
Alternatively, 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/).
73
81
74
-
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/).
75
82
76
-
## Installation Windows
83
+
## Library installation on MacOS
84
+
85
+
You can install dependencies with these commands:
86
+
87
+
```sh
88
+
brew install openssl zlib
89
+
```
90
+
91
+
You can compile and install the library like Linux instructions.
92
+
93
+
94
+
## Library installation on Windows
77
95
78
96
### Download vcpkg and tgbot-cpp
79
97
80
-
Taken from [Vcpkg - Quick Start: Windows](https://github.com/Microsoft/vcpkg/#quick-start-windows):
98
+
Taken from [Vcpkg - Quick Start: Windows](https://github.com/Microsoft/vcpkg/#quick-start-windows).
81
99
82
100
Prerequisites:
83
101
- Windows 7 or newer
84
102
- Git
85
103
- Visual Studio 2015 Update 3 or greater with the English language pack
86
104
87
-
First, download and bootstrap vcpkg itself; it can be installed anywhere,
88
-
but generally we recommend using vcpkg as a submodule for CMake projects,
89
-
and installing it globally for Visual Studio projects.
90
-
We recommend somewhere like `C:\src\vcpkg` or `C:\dev\vcpkg`,
91
-
since otherwise you may run into path issues for some port build systems.
105
+
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.
92
106
93
107
```cmd
94
108
> git clone https://github.com/microsoft/vcpkg
95
109
> .\vcpkg\bootstrap-vcpkg.bat
96
110
```
97
111
98
-
In order to use vcpkg with Visual Studio,
99
-
run the following command (may require administrator elevation):
112
+
In order to use vcpkg with Visual Studio, run the following command (may require administrator elevation):
100
113
101
114
```cmd
102
115
> .\vcpkg\vcpkg integrate install
@@ -120,22 +133,26 @@ The library will now be installed and Visual Studio should be able to find the v
120
133
121
134
Use the [example CMakeLists.txt](samples/echobot/CMakeLists.txt) with changes:
122
135
123
-
Remove `/usr/local/include`
124
-
125
-
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.
136
+
1. Remove `/usr/local/include`
137
+
2. 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.
0 commit comments