Skip to content

Commit

Permalink
Update the README to give better instructions for Android.
Browse files Browse the repository at this point in the history
The MingW link doesn't help for Android, and points people down the
wrong path.  On Android all you need to do is tell the build system
to use a newer compiler and standard library.

The unit tests run successfully with this configuration on Android.

Related to nlohmann#136.
  • Loading branch information
zewt committed Feb 28, 2016
1 parent 53879f9 commit 12aa72a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ I would be happy to learn about other compilers/versions.
Please note:

- GCC 4.8 does not work because of two bugs ([55817](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55817) and [57824](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57824)) in the C++11 support.
- For GCC running on MinGW or Android SDK, the error `'to_string' is not a member of 'std'` (or similarly, for `strtod`) may occur. Note this is not an issue with the code, but rather with the compiler itself. Please refer to [this site](http://tehsausage.com/mingw-to-string) and [this discussion](https://github.com/nlohmann/json/issues/136) for information on how to fix this bug.
- Android defaults to using very old compilers and C++ libraries. To fix this, add the following to your Application.mk.
This will switch to the LLVM C++ library, the Clang compiler, and enable C++11 and other features disabled by default.

```
APP_STL := c++_shared
NDK_TOOLCHAIN_VERSION := clang3.6
APP_CPPFLAGS += -frtti -fexceptions
```

- For GCC running on MinGW or Android SDK, the error `'to_string' is not a member of 'std'` (or similarly, for `strtod`) may occur. Note this is not an issue with the code, but rather with the compiler itself. On Android, see above to build with a newer environment. For MingW, please refer to [this site](http://tehsausage.com/mingw-to-string) and [this discussion](https://github.com/nlohmann/json/issues/136) for information on how to fix this bug.

## Examples

Expand Down

3 comments on commit 12aa72a

@gregmarr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all uses of strtold have been removed from the code.

@zewt
Copy link
Owner Author

@zewt zewt commented on 12aa72a Feb 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's one call to strtold, which I'm assuming won't be called unless NumberFloatType is long double. There are various other problems fixed by using a newer toolchain, of course.

@gregmarr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I thought that one had been removed by some of the recent work.

Please sign in to comment.