NDK r8b compile error on Mac Os environment

232 views
Skip to first unread message

elio francesconi

unread,
Sep 6, 2012, 4:55:42 AM9/6/12
to andro...@googlegroups.com
Hi all,
I'm in trouble trying to compile my code using a Mac Os environment, I'ld like to know if someone can help me on configuring my machine.

I've:
  • downloaded/extracted the android-ndk-r8b-darwin-x86.tar.bz2 in /Users/elio.francesconi/Applications/android-ndk-r8b/
  • configured PATH = $PATH:/Users/elio.francesconi/Applications/android-ndk-r8b/
  • configured my NDK_MODULE_PATH
Then I've compiled my project but I receive an include error:

/Users/elio.francesconi/Applications/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./obj/local/armeabi/objs-debug/test/Test.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -I/Users/elio.francesconi/Applications/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include -I/Users/elio.francesconi/Applications/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include -Ijni -DANDROID -DANDROID -Wa,--noexecstack -fexceptions -frtti -fexceptions  -O0 -g -fexceptions  -I/Users/elio.francesconi/Applications/android-ndk-r8b/platforms/android-8/arch-arm/usr/include -c  jni/test/Test.cpp -o ./obj/local/armeabi/objs-debug/test/Test.o 

/Users/elio.francesconi/Applications/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:64:11: error: '::tm' has not been declared
/Users/elio.francesconi/Applications/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:66:11: error: '::clock' has not been declared
....
been declared
/Users/elio.francesconi/Applications/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:73:11: error: '::localtime' has not been declared
/Users/elio.francesconi/Applications/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:74:11: error: '::strftime' has not been declared


where Test.cpp just includes <ctime> and uses.

#import <ctime>

My Application.mk includes:
APP_STL := gnustl_static 
APP_CPPFLAGS += -fexceptions 
APP_GNUSTL_FORCE_CPP_FEATURES := exceptions rtti

The same code compiles under Linux.

Someone can help me?
 

Thanks a lot
Elio

Abhiram Mishra

unread,
Apr 16, 2014, 5:46:02 AM4/16/14
to andro...@googlegroups.com

Add the following flag  basetsd.h: No such file or directory LOCAL_CFLAGS += -D_STLP_NO_CSTD_FUNCTION_IMPORTS , it would solve, It did for me. However I am using a diffrernt stl ( std_stl) and version 4.8. In your case look into the ctime.h/cpp file , you would get some hint

elio

unread,
Jul 15, 2014, 7:51:37 AM7/15/14
to andro...@googlegroups.com
Thanks Abhiram,
could you share your Android.mk and Application.mk?
Elio

Alex Cohn

unread,
Jul 15, 2014, 3:35:37 PM7/15/14
to andro...@googlegroups.com
I would strongly suggest to upgrade to NDK r9d and set NDK_TOOLCHAIN=4.8 in Application.mk

Alex Cohn
Reply all
Reply to author
Forward
0 new messages