Install the SDK Package
Runtime environment
It depends on open-source third-party libraries like curl, openssl, uuid, and jsoncpp. Among these, jsoncpp can be compiled and installed in the thirdlib directory.
SDK directory structure
1├─example // Usage example
2 ├─include // Header file
3│ └─bcesdk
4 │ ├─auth // BCE signature classes
5 │ ├─bos // SDK SDK service-related classes
6 │ │ ├─model // BCE common model classes
7 │ │ ├─request // SDK request classes
8 │ │ └─response // SDK response classes
9 │ ├─common // Log-related and file tool classes, such as file input and output streams
10 │ ├─http // BCE HTTP communication-related classes
11 │ ├─model // BOS internal models, such as request or response
12 │ └─util // BCE common utilities classes
13 ├─msvc // windows viusal studio related
14 ├─src // Source code path
15│ ├─auth
16│ ├─bench
17│ ├─bos
18│ │ ├─model
19│ │ ├─request
20│ │ └─response
21│ ├─http
22│ ├─model
23│ └─util
24 ├─thirdlib // Third-party library path
25 │ └─json // JSON dependency library path under Linux
Install SDK
Download the BOS C++ SDK toolkit from the official website.
User Installation Guide for Linux CentOS
Dependency public library installation:
1sudo yum install gcc-c++
2sudo yum install autoconf
3sudo yum install automake
4sudo yum install libuuid-devel
5sudo yum install openssl-devel
6sudo yum install libcurl-devel
7sudo yum install cmake
Execute the following command to generate the jsoncpp library in thirdlib:
1cd thirdlib/json
2cmake ./jsoncpp-1.9.0/
3make
4make install
Construct based on autotools environment
- Execute
sh autogen.shto generate configure; - Execute
configure, amd add the necessary options, such as--prefixorCXXFLAGS; - Execute
make & make install. The include and lib will be generated at the corresponding path.
Compilation reference
- If not installed in the default gcc path, use -L in CXXFLAGS to specify the lib path and -I to specify the include path;
- Specify
-lbossdkin LDFLAGS. - The C++ SDK requires an environment that supports C++11 or later. You can use CC= or CXX= to specify a higher version of the gcc or g++ compiler.
If writing compilation commands directly, you can also specify -L -I -l directly.
User Installation Guide for Linux Ubuntu & Debian
Dependency public library installation:
1sudo apt-get -y install build-essential
2sudo apt-get install autoconf
3sudo apt-get install uuid-dev
4sudo apt-get install libssl-dev
5sudo apt-get install libcurl4-openssl-dev
6sudo apt-get install cmake
Execute the following command to generate the jsoncpp library in thirdlib:
1cd thirdlib/json/
2cmake ./jsoncpp-1.9.0/
3make
4make install
Construct based on autotools environment
- Execute
sh autogen.shto generateconfigurefile; - Execute
configure, amd add the necessary options, such as--prefixorCXXFLAGS; - Execute
make & make install. The include and lib will be generated at the corresponding path.
Compilation reference
- If not installed in the default gcc path, use -L in CXXFLAGS to specify the lib path and -I to specify the include path;
- Include -lbossdk in the LDFLAGS configuration.
- cpp requires std-11 or higher environment.
CC=orCXX=can be used to specify a higher version of gcc or g++ compiler.
If writing compilation commands directly, you can also specify -L -I -l directly.
User Installation Guide for Windows
Environment preparation
- Install Visual Studio 2012 or a later version.
- Install CMake version 3.1 or newer.
- The thirdlib folder already includes the necessary third-party libraries (curl, jsoncpp). For other versions, please download them from their official websites.
Quick experience
- Unzip
windows_dependency.zipunder thirdlib directory tothirdlib. - Double-click
example\\example.sln
Compile for use
- Unzip
windows_dependency.zipunderthirdlibdirectory tothirdlib. -
Create a build directory
Plain Text1mkdir build 2cd build -
Generate target
sln cmake -G "\\<type>" ..Here, different \should be selected based on the installed Visual Studio version and compilation platform. Generate sln for Visual Studio 2015:
cmake -G "Visual Studio 14 2015" ..The compilation target for generating Visual Studio 2013 is 64-bit sln:cmake -G "Visual Studio 12 2013 Win64"For parameters, refer to CMake Help Document.
- Compile: Directly use cmake to compile
cmake --build .or manually openbossdk.sln. -
Compilation results are created in the output folder located within the code root directory. The folder structure is as follows:
Plain Text1output 2├── include 3│ └── bcesdk 4│ ├── auth 5│ ├── bos 6│ │ ├── model 7│ │ ├── request 8│ │ └── response 9│ ├── common 10│ ├── http 11│ ├── model 12│ └── util 13└── lib 14 ├── x64 15 │ ├── Debug 16 │ └── Release 17 └── x86 18 ├── Debug 19 └── Release -
Use SDK
Compile: Add
output/includeto theincludedirectory
Link: Actively linkbossdk.lib,jsoncpp.lib,LIBCURL.LIBExecute: PlaceLIBCURL.DLLin the same directory as the target exe
Compilation issues with versions below Visual Studio 2012
- Versions earlier than Visual Studio 2005 cause significant problems and are strongly discouraged.
- You must use Windows SDK version 7.1 or later.
- The issue that
stdint.hdoes not exist needs to be solved, and a small number of CRT functions such as: strtoull, strtoll, etc. should be replaced.
Uninstall SDK
If you plan to uninstall the SDK, delete the output path.
