I'm having some troubles using AWS C++ SDK, due to a serious lack of documentation. However I managed to compile and install it on my computer.
I'm now trying hard to have a program working and resolved quite a lot of problems, but a (hopefully) last one remains that I cannot defeat alone...
Here is the code :
#include <aws/s3/model/GetObjectRequest.h>
int main()
{
Aws::S3::Model::GetObjectRequest getObjectRequest;
}
I tried to have the simplest code for my example. That code doesn't compile, I've got the following error :
CMakeFiles/example.dir/example.cpp.o:(.rodata._ZTIN3Aws2S39S3RequestE[_ZTIN3Aws2S39S3RequestE]+0x10): undefined reference to `typeinfo for Aws::AmazonSerializableWebServiceRequest'
I don't get what the problem is. I tried checking in the source code of the library, and no pure virtual function remains in the GetObjectRequest class. I think I linked correctly the libraries. Here is my CMakeLists.txt :
project( TEST_AWS )
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
add_definitions ( -Wall -Wextra )
set(LIBAWSSDK_INCLUDE_DIR /usr/local/include/ CACHE STRING "aws SDK include directories")
set(LIBAWSSDK_CORE_LIB "-l:/usr/local/lib/libaws-cpp-sdk-core.so" CACHE STRING "aws SDK core link lib")
set(LIBAWSSDK_S3_LIB "-l:/usr/local/lib/libaws-cpp-sdk-s3.so" CACHE STRING "aws SDK S3 link lib")
set(target_external_libraries
${LIBAWSSDK_CORE_LIB}
${LIBAWSSDK_S3_LIB}
)
include_directories(
${LIBAWSSDK_INCLUDE_DIR}
)
add_executable( example example.cpp )
target_link_libraries( example ${target_external_libraries} )
target_compile_features(example PRIVATE cxx_lambdas)
I know the way I linked the library with cmake is a little bit dirty, but for the moment I just want the code to compile...