0

I want use std::nearbyint in android gcc but then ndk complains that std::nearbyint is not a member of std. I have the cmath header included in my code & the same builds well for OSX.

Is there a workaround for this ? Is possible to write my own version of std::nearbyint ? I am using NDK14b on android

TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159

1 Answers1

1

This is part of https://github.com/android-ndk/ndk/issues/82. GNU's libstdc++ is overly broad with their feature guards. We're working on stabilizing the NDK's solution for libc++ so we can just move entirely over to that instead.

Dan Albert
  • 10,079
  • 2
  • 36
  • 79
  • thanks for the update. it doesn't work for me no matter whatever CXX flags I put. I am using qmake. it might have to do with that. but this is only a problem with android:gcc it seems – TheWaterProgrammer May 02 '17 at 20:02
  • No cflags/cppflags will affect this. Those feature guards take affect when we build the NDK itself. – Dan Albert May 04 '17 at 00:55
  • Just tested with latest r17 canary build (as suggested in @dan-albert issue #82), but still got this error. See: https://github.com/nodejs/node/issues/14771 – Arnold Schrijver Aug 11 '17 at 12:27
  • https://github.com/android-ndk/ndk/issues/82#issuecomment-236979264 (switch to libc++) – Dan Albert Aug 11 '17 at 17:56