Skip to content

Can't cross-compile to Android - 'rethrow_exception' is not a member of 'std' #1219

@Nadav-Ruskin

Description

@Nadav-Ruskin

Description

I can't cross-compile the header to Android. Tried NDK 13b, 14b, and 16b. Is Android missing an integral part of the library? If so, please add a disclaimer.

[osboxes:/work/build] $ /usr/arm-linux-androideabi/bin/arm-linux-androideabi-g++ -std=gnu++14 -I ../3rdparty/catch/catch/ -o hello_world hello_world.cpp       
In file included from hello_world.cpp:1:0:
catch.hpp: In member function 'std::string Catch::ExceptionTranslatorRegistrar::ExceptionTranslator<T>::translate(std::vector<std::unique_ptr<const Catch::IExceptionTranslator> >::const_iterator, std::vector<std::unique_ptr<const Catch::IExceptionTranslator> >::const_iterator) const':
catch.hpp:1798:7: error: 'rethrow_exception' is not a member of 'std'
       std::rethrow_exception(std::current_exception());
       ^
catch.hpp:1798:30: error: 'current_exception' is not a member of 'std'
       std::rethrow_exception(std::current_exception());

Steps to reproduce

  1. Install NDK. For comfort, I started out with an image from dockcross.
  2. Put catch.hpp in a directory.
  3. Make hello_world.cpp in same directory:
#include "catch.hpp"

TEST_CASE("test 1")
{
REQUIRE(1==1);
}
  1. Compile, making sure to use the right flags.
[osboxes:/work/build] 1 $ /usr/arm-linux-androideabi/bin/arm-linux-androideabi-g++ -std=gnu++11 -o hello_world hello_world.cpp
In file included from hello_world.cpp:1:0:
catch.hpp: In member function 'std::string Catch::ExceptionTranslatorRegistrar::ExceptionTranslator<T>::translate(std::vector<std::unique_ptr<const Catch::IExceptionTranslator> >::const_iterator, std::vector<std::unique_ptr<const Catch::IExceptionTranslator> >::const_iterator) const':
catch.hpp:1798:7: error: 'rethrow_exception' is not a member of 'std'
       std::rethrow_exception(std::current_exception());
       ^
catch.hpp:1798:30: error: 'current_exception' is not a member of 'std'
       std::rethrow_exception(std::current_exception());
                              ^

Extra information

  • Catch version: 2.2.0
  • Operating System: Debian
  • Compiler+version: arm-linux-androideabi-g++ versions 13b, 14b, and 16b.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions