1
0
mirror of https://github.com/danog/ton.git synced 2024-12-02 17:38:33 +01:00
ton/example/cpp/README.md

22 lines
655 B
Markdown
Raw Normal View History

# Tonlib C++ basic usage examples
2019-09-07 12:03:22 +02:00
Tonlib should be prebuilt and installed to local subdirectory `tonlib/`:
2019-09-07 12:03:22 +02:00
```
cd <path to Ton sources>
2019-09-07 12:03:22 +02:00
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../example/cpp/tonlib ..
2019-09-07 12:03:22 +02:00
cmake --build . --target install
```
Then you can build the examples:
```
cd <path to Ton sources>/example/cpp
2019-09-07 12:03:22 +02:00
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DTonlib_DIR=<full path to Ton sources>/example/cpp/tonlib/lib/cmake/Tonlib ..
2019-09-07 12:03:22 +02:00
cmake --build .
```
To run `tonjson_example` you may need to manually copy a `tonlibjson` shared library from `tonlib/bin` to a directory containing built binaries.