aws-sdk-cpp: Linking error when completing C++ SDK build

What platform/OS are you using?

Amazon Linux/g++ (GCC) 7.2.1 20170915

Which version of the SDK?

1.6.0 (I think)

What compiler are you using? what version?

AWS C9

What are your CMake arguments?

Linking CXX executable aws-cpp-sdk-core-tests

Can you provide a TRACE level log? (sanitize any sensitive information)

/bin/sh: line 1: 5833 Segmentation fault ./aws-cpp-sdk-core-tests --gtest_shuffle --gtest_repeat=3 make[2]: *** [aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests] Error 139 make[2]: *** Deleting file `aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests’ make[1]: *** [aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/all] Error 2 make: *** [all] Error 2

https://docs.aws.amazon.com/cloud9/latest/user-guide/sample-cplusplus.html#sample-cplusplus-sdk Hi, I am following the c++ sample and trying to build c++ SDK into my environment via AWS c9. I am getting the above errors as I come to make completion via building SDK. How do I resolve my build? Maybe there is a folder/directory issue and a file cannot be found? This is my first issue here so I hope I am not breaking any guidelines posting this.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Hi @KaibaLopez, I have made it work on my end. Here were what I found out (and the solutions).

  • AWS SDK looks for the binary and includes folders from install path of sdk_build as per AWSSDKConfig.cmake. We shall add into ~/environment/CMakeLists.txt the following: set(AWSSDK_ROOT_DIR, "/usr/local/")
  • The project builds aws sdk as shared libs, but ~/environment/CMakeLists.txt looks shared libs flag has not been turned on, therefore it looks for static libs, we need to turn this on set(BUILD_SHARED_LIBS ON)
cmake_minimum_required(VERSION 3.5)
project(s3-demo)
set(AWSSDK_ROOT_DIR, "/usr/local/")
set(BUILD_SHARED_LIBS ON)
find_package(AWSSDK REQUIRED COMPONENTS s3)
add_executable(s3-demo s3-demo.cpp)
target_link_libraries(s3-demo ${AWSSDK_LINK_LIBRARIES})

Built with commands above and tested in terminal with ./s3-demo my-test-bucket us-west-2