百度智能云

All Product Document

          Object Storage

          SDK Installation

          Runtime Environment

          It relies on open-source third-party libraries, including curl, openssl, uuid, and jsoncpp. jsoncpp can be compiled and installed in the thirdlib folder.

          SDK's Directory Structure

          ├─example // Use case   
          ├─include // Header file  
          │  ├─bcesdk   
          │      ├─auth        // BCE's signature related class  
          │      ├─bos         // SDK service related class  
          │      │  ├─model    // BCE's public model class  
          │      │  ├─request  // SDK request class  
          │      │  ├─response // SDK response class  
          │      ├─common      // Log-related and file tool classes, such as file input and output streams.   
          │      ├─http        // BCE's Http communication related class   
          │      ├─model       // Internal model of BOS, such as Request or Response   
          │      ├─util        // BCE's utility tool class   
          ├─msvc               // windows viusal studio related   
          ├─src                // Source code path   
          │  ├─auth   
          │  ├─bench   
          │  ├─bos   
          │  │  ├─model   
          │  │  ├─request  
          │  │  ├─response  
          │  ├─http  
          │  ├─model  
          │  ├─util  
          ├─thirdlib // Third party library path  
          │  ├─json  // json-dependent library path under linux  

          Install SDK

          Download BOS C++ SDK Toolkit on the official website.

          Linux User Installation Guide

          To generate the jsoncpp library in thirdlib, execute the following command. Please install the other libraries by yourself. And we recommend that you can use the yum install.

          cd thirdlib/json 
          make 
          make install 

          Construction Based on Autotools Environment

          1.Execute sh autogen.sh to generate configure; 2.Execute configure and add options, such as --prefix or CXXFLAGS; 3.Execute make & make install, which generates include and lib on the corresponding path.

          Compile for Reference

          1.If it is not installed under the gcc default path, specify the lib path using -L in CXXFLAGS and the include path using -I; 2.Specify -lbossdk in LDFLAGS.

          If the command is compiled directly, you can also directly specify -L -I -l.

          Windows User Installation Guide

          Environmental Preparation

          1.Install Visual studio 2012 or above. 2.Install CMake 3.1 or above. 3.thirdlib already includes all the required third-party libraries (curl, jsoncpp). If you need other versions, please download them from the official website.

          Quick Experience

          1.Unzip windows_dependency.zip under the thirdlib directory to thirdlib. 2.Double click example\example.sln.

          Compile for Use

          1.Unzip windows_dependency.zip under the thirdlib directory to thirdlib.

          2.Create build directory.

              mkdir build 
              cd build 

          3.Build target sln cmake -G "\< type>" .. Select different \< type> depending on the version of Visual Studio installed and the compilation platform.

          Generate SLN for Visual Studio 2015: cmake -G "Visual Studio 14 2015" .. Build the Visual Studio 2013 compilation target with 64-bit sln: cmake -G "Visual Studio 12 2013 Win64"

          For details of parameters, please see CMake Help Document.

          4.Compile: Compile cmake--build directly using cmake. Or open bossdk.sln manually.

          5.Generate result: The compilation results will be generated under the output folder in the code root directory. The structure is as follows:

              output  
              ├── include  
              │   ├── bcesdk   
              │       ├── auth  
              │       ├── bos  
              │       │   ├── model  
              │       │   ├── request  
              │       │   ├── response  
              │       ├── common  
              │       ├── http  
              │       ├── model  
              │       ├── util  
              ├── lib  
                  ├── x64  
                  │   ├── Debug  
                  │   ├── Release  
                  ├── x86  
                      ├── Debug  
                      ├── Release  

          6.Use SDK

          Compile: Add output/include to include directory.
          Link: Active link bossdk.lib, jsoncpp.lib, LIBCURL.LIB
          Execute: Put LIBCURL.DLL in the same directory as the target exe.

          Compilation Issues below Visual Studio 2012

          1.Those below Visual Studio 2005 will face various problems and are strongly not recommended. 2.You must use windows SDK 7.1 or above. 3.The problem of absence of stdint.h needs to be solved and a small number of CRT functions such as strtoull and strtoll need to be replaced. strtoull, strtoll, etc.

          Uninstall SDK

          Delete the output path when the SDK is expected to be uninstalled.

          Previous
          Overview
          Next
          Initialization