1
我發現,亞馬遜有一個SDK在C++(github link),但我不能獲得通過CMake的鏈接吧...是否需要將aws-sdk-cpp與CMake鏈接?
我已經做了自述文件中的步驟:
mkdir BUILD_DIR
cd BUILD_DIR
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
但什麼是通過CMake鏈接它的方式?我試過find_package(aws-cpp-sdk)
,但是找不到它。請幫忙嗎? :)
好了,到最後我已經找到一種方法來做到這一點:
set(AWS_CPP_SDK_INCLUDE_DIRS /path/to/include/aws CACHE STRING "aws-cpp-sdk include directories")
set(AWS_CPP_SDK_CORE_LIB "-l:/path/to/libaws-cpp-sdk-core.so" CACHE STRING "aws-cpp-sdk link core lib")
set(AWS_CPP_SDK_S3_LIB "-l:/path/to/libaws-cpp-sdk-s3.so" CACHE STRING "aws-cpp-sdk link S3 lib")
然後使用變量連接
感謝@Tsyvarev的幫助,它給我這個想法
但問題是,它說,它不覺得在執行時aws-cpp-sdk-core.so:
error while loading shared libraries: libaws-cpp-sdk-core.so: cannot open shared object file: No such file or directory
像往常一樣,使用[find_file](https://cmake.org/cmake/help/v3.0/command/find_file.html)檢測include目錄,使用[find_library](https: //cmake.org/cmake/help/v3.0/command/find_library.html)查找所需的庫。 – Tsyvarev