Install SDK Toolkit
Runtime environment
It relies on open-source third-party libraries, including libcurl-devel, apr, and jansson. Among these, jansson can be compiled and installed in the thirdlib directory.
SDK directory structure
1├─MakeList.txt
2 ├─bos_c_sdk.sln // windows viusal studio related
3├─util
4 ├─bos_c_sdk // Source code path
5│ ├─auth
6│ ├─bce
7│ ├─http
8│ ├─sts
9│ ├─api
10 ├─third_part // Third-party library path
11├─bos_c_sdk_test
12├─bos_c_sdk_ut
Install SDK
Users can submit a ticket to contact the support team to obtain the installation package.
User Installation Guide for Linux CentOS
Dependency public library installation:
1yum -y install libcurl-devel
2yum install apr-util
3yum install apr-devel
4yum install apr-util-devel
Install the jansson library
a. Download the source code: Go to Jansson's official website and download the latest stable version of the source code package.
b. Extract the file: Use the tar command to decompress the downloaded archive, where "version" refers to the downloaded version number.
1tar -xzf jansson-<version>.tar.gz
c. Navigate to the extracted directory, and execute the following commands. These will configure, compile, and install the Jansson library onto your system.
1./configure
2make
3sudo make install
Environment construction
1tar zxf bos-c-sdk-1.0.0.tar.gz
2cd bos-c-sdk-1.0.0
3cmake .
4make
5sudo make install
If you need to specify the installation directory
1cmake -f CMakeLists.txt
2 // The compilation type is Release. Common compilation types are: Debug, Release, RelWithDebInfo, and MinSizeRel. The default is Debug.
3-DCMAKE_BUILD_TYPE=Release
4 // Custom installation directory.
5-DCMAKE_INSTALL_PREFIX=/usr/local/
6 // Specify the directories where the header files and library files of the third-party libraries curl, apr, apr-util, and xml are located.
7-DCURL_INCLUDE_DIR=/usr/include/curl
8-DCURL_LIBRARY=/usr/lib64/libcurl.so
9-DAPR_INCLUDE_DIR=/usr/include/apr-1
10-DAPR_LIBRARY=/usr/lib64/libapr-1.so
11-DAPR_UTIL_INCLUDE_DIR=/usr/include/apr-1
12-DAPR_UTIL_LIBRARY=/usr/lib64/libaprutil-1.so
13-DMINIXML_INCLUDE_DIR=/usr/include
14-DMINIXML_LIBRARY=/usr/lib64/libmxml.so
15 // If an error “Could not find apr-config/apr-1-config” occurs during compilation, the reason is that the apr-1-config file cannot be found in the default path. Please add this option.
16-DAPR_CONFIG_BIN=/path/to/bin/apr-1-config
17 // If an error “Could not find apu-config/apu-1-config” occurs during compilation, the reason is that the apu-1-config file cannot be found in the default path. Please add this option.
18-DAPU_CONFIG_BIN=/path/to/bin/apu-1-config
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.
For compiling the written program, you can also directly specify -L -I -l.
1gcc -Wall -O -g -I. -I /usr/local/include/bos_c_sdk -I /usr/include/apr-1 -c main.c -o main.o
2gcc main.o -o main -lpthread -L/usr/local/lib -lbos_c_sdk -lcurl -lmxml -L/usr/local/apr/lib -lapr-1 -laprutil-1 -ljansson
Uninstall SDK
If you plan to uninstall the SDK, delete the output path.
