I tried to include /usr/include folder to the project. But then builder gave me a count of collisions. How can I avoid them?
In file included from /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/sys/limits.h:47:0, from /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/limits.h:86, from /usr/include/limits.h:125, from /home/georg/android/cocos2d_x/cocos2dx/support/data_support/ccCArray.h:50, from /home/georg/android/cocos2d_x/cocos2dx/cocoa/CCArray.h:28, from /home/georg/android/cocos2d_x/cocos2dx/base_nodes/CCNode.h:33, from /home/georg/android/cocos2d_x/cocos2dx/actions/CCActionInterval.h:30, from /home/georg/android/cocos2d_x/cocos2dx/include/cocos2d.h:42, from jni/../../Classes/AppDelegate.h:4, from jni/helloworld/main.cpp:1: /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/machine/limits.h:40:0: warning: "MB_LEN_MAX" redefined [enabled by default] /usr/include/limits.h:33:0: note: this is the location of the previous definition In file included from /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/sys/_types.h:40:0, from /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:50, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/4.6.3/include/bits/ctype_base.h:33, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/bits/locale_facets.h:43, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/bits/basic_ios.h:39, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/ios:45, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/istream:40, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/sstream:39, from /home/georg/android/cocos2d_x/cocos2dx/label_nodes/CCLabelBMFont.h:38, from /home/georg/android/cocos2d_x/cocos2dx/include/cocos2d.h:95, from jni/../../Classes/AppDelegate.h:4, from jni/helloworld/main.cpp:1: /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/machine/_types.h:103:15: error: conflicting declaration 'typedef int __clock_t' /usr/include/bits/types.h:145:27: error: '__clock_t' has a previous declaration as 'typedef long int __clock_t' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/machine/_types.h:106:15: error: conflicting declaration 'typedef int __time_t' /usr/include/bits/types.h:149:26: error: '__time_t' has a previous declaration as 'typedef long int __time_t' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/machine/_types.h:107:15: error: conflicting declaration 'typedef int __timer_t' /usr/include/bits/types.h:161:27: error: '__timer_t' has a previous declaration as 'typedef void* __timer_t' In file included from /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:50:0, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/4.6.3/include/bits/ctype_base.h:33, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/bits/locale_facets.h:43, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/bits/basic_ios.h:39, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/ios:45, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/istream:40, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/sstream:39, from /home/georg/android/cocos2d_x/cocos2dx/label_nodes/CCLabelBMFont.h:38, from /home/georg/android/cocos2d_x/cocos2dx/include/cocos2d.h:95, from jni/../../Classes/AppDelegate.h:4, from jni/helloworld/main.cpp:1: /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/sys/_types.h:43:19: error: conflicting declaration 'typedef __int32_t __dev_t' /usr/include/bits/types.h:134:25: error: '__dev_t' has a previous declaration as 'typedef __u_quad_t __dev_t' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/sys/_types.h:49:20: error: conflicting declaration 'typedef __uint32_t __ino_t' /usr/include/bits/types.h:137:25: error: '__ino_t' has a previous declaration as 'typedef long unsigned int __ino_t' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/sys/_types.h:50:15: error: conflicting declaration 'typedef long int __key_t' /usr/include/bits/types.h:155:25: error: '__key_t' has a previous declaration as 'typedef int __key_t' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/sys/_types.h:54:20: error: conflicting declaration 'typedef __uint64_t __rlim_t' /usr/include/bits/types.h:146:26: error: '__rlim_t' has a previous declaration as 'typedef long unsigned int __rlim_t' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/sys/_types.h:58:19: error: conflicting declaration 'typedef __int32_t __swblk_t' /usr/include/bits/types.h:154:27: error: '__swblk_t' has a previous declaration as 'typedef long int __swblk_t' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/sys/_types.h:61:19: error: conflicting declaration 'typedef __int32_t __suseconds_t' /usr/include/bits/types.h:151:31: error: '__suseconds_t' has a previous declaration as 'typedef long int __suseconds_t' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/sys/_types.h:70:3: error: conflicting declaration 'typedef union __mbstate_t __mbstate_t' /usr/include/wchar.h:95:3: error: '__mbstate_t' has a previous declaration as 'typedef struct __mbstate_t __mbstate_t' In file included from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/4.6.3/include/bits/ctype_base.h:33:0, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/bits/locale_facets.h:43, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/bits/basic_ios.h:39, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/ios:45, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/istream:40, from /home/georg/android/android_ndk/sources/cxx-stl/gnu-libstdc++/include/4.6.3/sstream:39, from /home/georg/android/cocos2d_x/cocos2dx/label_nodes/CCLabelBMFont.h:38, from /home/georg/android/cocos2d_x/cocos2dx/include/cocos2d.h:95, from jni/../../Classes/AppDelegate.h:4, from jni/helloworld/main.cpp:1: /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:88:40: error: expected initializer before '__pure' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:89:37: error: expected initializer before '__pure' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:90:37: error: expected initializer before '__pure' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h: In function 'int __maskrune(__ct_rune_t, long unsigned int)': /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:116:58: error: '___runetype' was not declared in this scope /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h: At global scope: /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:140:1: error: expected primary-expression before '_c' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:140:1: error: expected ')' before '_c' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:146:1: error: expected ']' before 'static' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:146:1: error: expected ')' before 'static' /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h: In function '__ct_rune_t __tolower(__ct_rune_t)': /home/georg/android/android_ndk/platforms/android-14/arch-arm/usr/include/_ctype.h:163:56: error: '___tolower' was not declared in this scope make: *** [obj/local/armeabi/objs-debug/game_shared/helloworld/main.o] Ошибка 1
Yes, I solve the last problem. But now I have new one
I have an Anrdoid application implemented with help of cocos2d-x engine. I linked protobuf library to the project and trying to SerializeToStrint() one proto-object:
I solved this problem one hour ago. All trick was in gnustl library. I link that lib like static library. But then I have read in ndk manual: ‘Please keep in mind that the static library variant of a given C++ runtime SHALL ONLY BE LINKED INTO A SINGLE BINARY for optimal conditions.’
i worked with it for two days ,nothing get、、、
Georgiy Lehovskiy ,have you get it?
how?
i cant use it in android。。。~~
If you have the same problem all that you need is to link gnustl as dynamic lib.
In Application.mk change APP_STL := gnustl_static to APP_STL := gnustl_shared