Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android? #172

Closed
EvilPudding opened this issue Jan 4, 2016 · 8 comments
Closed

Android? #172

EvilPudding opened this issue Jan 4, 2016 · 8 comments
Labels
platform: android related to Android NDK

Comments

@EvilPudding
Copy link

Is this supposed to work on android with NDK? I really need it to, but I'm getting so many errors that I'm getting scared, because I have very close deadline.

@ZahlGraf
Copy link

ZahlGraf commented Jan 4, 2016

Yes it works on android NDK. My current student project (see the JSON lib code here integrated in the project: https://github.com/ZahlGraf/mySafeCore/tree/master/dependencies/json ) uses it with Android NDK r10e (see travis-CI, here it is build frequently).
It is very important, that you enable c++11 support and I use the "gnustl_static" runtime library instead of the default one.

@gregmarr
Copy link
Contributor

gregmarr commented Jan 4, 2016

we use the c++_shared library and it works fine with that as well.

@EvilPudding
Copy link
Author

For compatibility reasons, I'm using ndk 8, but I'm
specifying gcc's version so it has all the new c++
features. Is it just not possible to do it in 8?
The errors are related to to_string and strtold
not being defined...
This is what I got in Application.mk

#APP_STL := stlport_static
APP_STL := gnustl_static

APP_CPPFLAGS := -std=c++11 -frtti
APP_ABI := armeabi
NDK_TOOLCHAIN_VERSION=4.8

@EvilPudding
Copy link
Author

Oh snap, @ZahlGraf, that link shows me he has
to specify those two functions manually... Why
isn't that patch on the oficial repo? I don't get it...

@ZahlGraf
Copy link

ZahlGraf commented Jan 4, 2016

I think with gcc 4.8 (is this the toolchain version??) there are issues with this lib: #110
But actually that are compiler issues and not issues from the lib. I use gcc-4.9 in my project.

@EvilPudding These functions are missing for any reason in some gcc libraries for Android. I think the patch has been reintegrated, because other libs for Android support it. So if you have compile issues due to these missing functions, just apply the patch.

I think this lib here is very cool, but it needs latest compilers. If you have issues with the compiler, there is another simple lib for JSON, that may work also on older compilers: RapidJSON

@EvilPudding
Copy link
Author

@ZahlGraf I have no time to migrate to a different lib
now, I'm applying the patch, it's working now, but I still
had to manuallyenable exceptions.

gcc 4.9 is not avaliable in ndk 8, so I won't have access
to it.

@ZahlGraf
Copy link

ZahlGraf commented Jan 4, 2016

@EvilPudding I hope it runs well for you now. Have a lot of luck and success by finishing your project :)

@EvilPudding
Copy link
Author

@ZahlGraf Thanks.

@nlohmann nlohmann added the platform: android related to Android NDK label May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: android related to Android NDK
Projects
None yet
Development

No branches or pull requests

4 participants