This article introduces the download address and installation method for the TOS C++ SDK.
Environmental Preparation
Before installing the TOS C++ SDK, ensure that the following dependencies have been installed:
- CMake version 3.1 or higher
- GCC version 4.8 or later
- Clang version 3.3 and later
- Visual Studio 2019 or later is required in the Windows environment.
Download Link
Installation Method
warning
The C++ SDK is currently not supported for installation or use on Android or Linux ARM systems.
Compiling from Source Code
Linux
macOS
Windows
warning
The SDK depends on the libcurl and openssl libraries. Before building the SDK, please ensure that both libraries have been installed.
- Download the source code. You may download the source code using the following methods:
- Direct download: See the source code address for the TOS C++ SDK at TOS C++ SDK. The latest version is determined by the updates in Git.
- Download via Git: Execute the following command to clone the source code to your local machine.
- Execute the following command to build using CMake version 3.1 or above.
- Execute the following command to install libcurl and openssl.
- Execute the following commands to compile and install.
On macOS, you can install dependency libraries using the brew package manager.
On macOS systems, the path to the OpenSSL library must be specified. Assuming that OpenSSL is installed in the /usr/local/Cellar/openssl@3/3.0.0 directory, you can execute the following commands to compile.
Run the VS Developer Command Prompt as an administrator, then execute the following commands in the build directory to compile and install.
CMake Compilation Options
Disabled by default; CMake compiles only static libraries by default. After opening the project, CMake will simultaneously compile both the static and dynamic libraries, and at the same time, the SDK will link to the dynamic library.
warning
The BUILD_SHARED_LIB compilation option is currently not supported in the Windows environment.
Disabled by default. After opening the project, CMake will compile the examples in the example folder, which can then be run directly. Refer to the examples in the example folder.
Disabled by default. After opening the project, CMake will compile the unit test cases in the test folder. Note that if you need to compile the unit test section, cmake must be greater than version 3.14.
Upgrade to Version 2
To upgrade to TOS C++ SDK V2, you must modify the client initialization method. Compared to the V1 version, the V2 version has the following characteristics:
- Enhanced interface capabilities: V2 supports a broader range of interfaces and is continuously improved.
- Additional value-added features are available, with certain V2 interfaces supporting event callbacks, progress notifications, rate limiting, and other value-added features.
tip
New features will not be added to Version V1 in the future; we recommend using Version V2.
Before modification
The initialization of the TosClient client is as follows.
Revised
Initialize the TosClientV2 client as follows.
warning
The initialization parameters for the client have changed in the upgrade to V2: the endpoint parameter, which was the first required parameter in Client V1, has been modified to an optional parameter in Client V2. If you still need to specify the endpoint, please refer to Setting Optional Parameters for detailed steps.