catchorg / catchorg/Catch2

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

Open
#1,219 6 comments 0 reactions 0 assignees View on GitHub
3rd party bug
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

## 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::translate(std::vector >::const_iterator, std::vector >::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](https://github.com/dockcross/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);
}
```
4) 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::translate(std::vector >::const_iterator, std::vector >::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.**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.