1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-13 03:32:22 +00:00
ton/example/cpp/README.md

22 lines
655 B
Markdown
Raw Normal View History

# Tonlib C++ basic usage examples
2019-09-07 10:03:22 +00:00
Tonlib should be prebuilt and installed to local subdirectory `tonlib/`:
2019-09-07 10:03:22 +00:00
```
cd <path to Ton sources>
2019-09-07 10:03:22 +00:00
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../example/cpp/tonlib ..
2019-09-07 10:03:22 +00:00
cmake --build . --target install
```
Then you can build the examples:
```
cd <path to Ton sources>/example/cpp
2019-09-07 10:03:22 +00: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 10:03:22 +00: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.