- OSS C SDK = 3.x.x
- Not supported
Firstly, install the OSS C SDK. For installation steps, see Install the C SDK.
- If the OSS C SDK and its dependencies are all installed under the system directory (/usr/local/ or /usr/) and you want to install the OSS MEDIA C SDK to the system directory too, you can run the following command to compile and install the SDK:
- After the preceding command is successfully run, the OSS MEDIA C SDK is installed to the /usr/local/ directory.
- If the OSS C SDK and its dependencies are all installed under the system directory (/usr/local/ or /usr/), but you want to install the OSS MEDIA C SDK to a custom directory such as /home/user/aliyun/oss/install/, you can run the following command to compile and install the SDK:
cmake . -DCMAKE_INSTALL_PREFIX=/home/user/aliyun/oss/install/usr/local/
- Once you run the preceding command, the OSS MEDIA C SDK is installed to the /home/user/aliyun/oss/install/usr/local/ directory.
- If the OSS C SDK or some dependency packages are installed to a custom directory, you cannot find the header files and library files of these packages by default, when you compile the OSS MEDIA C SDK. You must specify the path when you run the
cmakecommand. For example, if you have installed the OSS C SDK to the /home/user/aliyun/oss/install/ directory, run the following command to compile and install the SDK:
cmake . -DCMAKE_INSTALL_PREFIX=/home/user/aliyun/oss/install/usr/local/ -DOSS_C_SDK_INCLUDE_DIR=/home/user/aliyun/oss/install/usr/local/include/ -DOSS_C_SDK_LIBRARY=/home/user/aliyun/oss/install/usr/local/lib/liboss_c_sdk.so
Once you run the preceding command, the OSS MEDIA C SDK is installed to the /home/user/aliyun/oss/install/usr/local/ directory.
Names of other related parameters for other dependency packages include: APR_UTIL_LIBRARY, APR_LIBRARY, CURL_LIBRARY, APR_INCLUDEDIRS, APU_INCLUDEDIRS, OSS_C_SDK_INCLUDE_DIR, and CURL_INCLUDEDIRS.
- The client SDK and the server SDK are installed at the same time by default. If you only need to compile and install the client SDK, run the following command:
cmake . -DONLY_BUILD_CLIENT=ON
If you only need to compile and install the server, modify ONLY_BUILD_CLIENT to ONLY_BUILD_SERVER.
The testing example are compiled only when the client and server SDKs are compiled at the same time.
Compile mode: Currently four types are supported, namely Debug, Release, MinSizeRef, and RelWithDebInfo. You can specify a compilation type using the parameter
-DCMAKE_BUILD_TYPE. For example, if you want to use Debug mode for compilation, add the parameter
-DCMAKE_BUILD_TYPE=Debug: cmake . -DCMAKE_BUILD_TYPE=Debug. The Release mode is adopted by default.
- Debug: No code optimization is performed. GDB is supported. This mode is generally used for program debugging.
- Release: More advanced optimization. This mode is generally applicable to the production environment.
- MinSizeRef: This mode generates the smallest library file and is generally used in the embedded environment.
- RelWithDebInfo: More advanced optimization approach. This mode carries debugging information and is generally used for the production environment.
If the “Targets may link only to libraries. CMake is dropping the item” warning is prompted during
cmakeexecution, the cause is that the specified library path is incorrect. The library path must be specified to
*.so, such as
If you want to use the static library of the OSS C SDK, specify the
cmakeexecution. Other libraries are similar.
If “CMake Error: The following variables are used in this project, but they are set to NOTFOUND.” is prompted when you run the cmake, this is because the corresponding library cannot be found in the default path and must be specified. See “Install to a custom directory”.