Aws-sdk-cpp: Mangled name compile error C++17

Created on 24 Jul 2017  Â·  8Comments  Â·  Source: aws/aws-sdk-cpp

I'm running Arch Linux with g++ 7.1.1 and cmake 3.8.2. When running make I get the following error near the end
shell Scanning dependencies of target aws-cpp-sdk-dynamodb-integration-tests [ 99%] Building CXX object aws-cpp-sdk-dynamodb-integration-tests/CMakeFiles/aws-cpp-sdk-dynamodb-integration-tests.dir/RunTests.cpp.o [ 99%] Building CXX object aws-cpp-sdk-dynamodb-integration-tests/CMakeFiles/aws-cpp-sdk-dynamodb-integration-tests.dir/TableOperationTest.cpp.o In file included from /home/user/dev/cpps3/deps/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/DefaultRateLimiter.h:21:0, from /home/user/dev/cpps3/deps/aws-sdk-cpp/aws-cpp-sdk-dynamodb-integration-tests/TableOperationTest.cpp:29: /home/user/dev/cpps3/deps/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSFunction.h:57:3: error: mangled name for ‘F Aws::BuildFunction(F) [with F = std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > > (*)() noexcept]’ will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type] F BuildFunction(F f) ^~~~~~~~~~~~~ cc1plus: all warnings being treated as errors make[2]: *** [aws-cpp-sdk-dynamodb-integration-tests/CMakeFiles/aws-cpp-sdk-dynamodb-integration-tests.dir/build.make:89: aws-cpp-sdk-dynamodb-integration-tests/CMakeFiles/aws-cpp-sdk-dynamodb-integration-tests.dir/TableOperationTest.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:6073: aws-cpp-sdk-dynamodb-integration-tests/CMakeFiles/aws-cpp-sdk-dynamodb-integration-tests.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

feature-request

Most helpful comment

A workaround would be to add -Wno-noexcept-type flag.

This warning IMO is benign in this case. It would only become a problem if:
a) you're using dynamic linking and
b) built aws-cpp-sdk-core using a pre C++17 compiler and
c) built whatever uses core using a C++17 compiler (in this case the unit tests)

And if your executable contains binaries built with different compilers, you've got bigger problems.

All 8 comments

We have a general story where we are hoping to clean up and support exception handling better. It's on our backlog.

What is expected time to fix this issue ?

I get the same error when running make on MacOs. Is there any update on the fix or workaround to be used?
Thx a lot

A workaround would be to add -Wno-noexcept-type flag.

This warning IMO is benign in this case. It would only become a problem if:
a) you're using dynamic linking and
b) built aws-cpp-sdk-core using a pre C++17 compiler and
c) built whatever uses core using a C++17 compiler (in this case the unit tests)

And if your executable contains binaries built with different compilers, you've got bigger problems.

g++ 7.1.1 supports c++17. I resolved this issue by changing the c++ standard in the CMakeLists.txt file in the root directory. I changed:
set(CPP_STANDARD "11" CACHE STRING "Flag to upgrade the C++ standard used. The default is 11. The minimum is 11.") to set(CPP_STANDARD "17" CACHE STRING "Flag to upgrade the C++ standard used. The default is 17. The minimum is 17.")

I build two versions:

  • for C11 by adding in unzipped file aws-sdk-cpp-master/cmake/compiler_settings.cmake -Wno-noexcept-type option
    list(APPEND AWS_COMPILER_WARNINGS "-Wall" "-Werror" "-pedantic" "-Wextra" "-Wno-noexcept-type")

    • for C14 by calling cmake with -DCPP_STANDARD=14 (17 also works)

Thank you everyone for help !

I just want to add that -DCPP_STANDARD=14 doesn't work for me. I had to do -DCPP_STANDARD=17 in order for it to compile.

This issue could be closed because we removed AWSFunction for good now.

Was this page helpful?
0 / 5 - 0 ratings