http://stackoverflow.com/questions/8564050/android-ndk-error-in-strings-h-possibly-due-to-error-in-size-t/9555542#9555542
I manageed to finish the make by commenting the lines in strings.h that showed error. Also I used memset in AuDispose.c instead of bzero.
here's the problem:
I'm having problems with building X11 for Android using the NDK. I'm using the latest NDK with droid-wrapper. I've updateddroid-wrapperto
work with most of the things I'm building, but it really just adds a bunch of compiler options. I have it print out what options it's using below. I've gotten pretty far, but I am running into this problem building some of the libraries:
CC AuDispose.lo
droid-debug(compile): /opt/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -DHAVE_CONFIG_H -I. -I./include -I/home/rmason/androix/usr/include -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -Wbad-function-cast -Wformat=2 -Wold-style-definition -Wdeclaration-after-statement -I/home/rmason/androix/usr/include -MT AuDispose.lo -MD -MP -MF .deps/AuDispose.Tpo -c AuDispose.c -fPIC -DPIC -o .libs/AuDispose.o -I/opt/android-ndk-r7/platforms/android-8/arch-arm/usr/include -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -DANDROID -DSK_RELEASE -DNDEBUG -UDEBUG -march=armv5te -mtune=xscale -msoft-float -mthumb-interwork -fpic -fno-exceptions -ffunction-sections -funwind-tables -fstack-protector -fmessage-length=0
In file included from /opt/android-ndk-r7/platforms/android-8/arch-arm/usr/include/stdlib.h:42,
from AuDispose.c:34:
/opt/android-ndk-r7/platforms/android-8/arch-arm/usr/include/strings.h:47: error: expected declaration specifiers or '...' before numeric constant
/opt/android-ndk-r7/platforms/android-8/arch-arm/usr/include/strings.h:47: error: conflicting types for 'memset'
AuDispose.c: In function 'XauDisposeAuth':
AuDispose.c:44: error: too many arguments to function 'memset'
make[1]: *** [AuDispose.lo] Error 1
make[1]: Leaving directory `/home/rmason/androix/lib/libXau'
make: *** [install] Error 2
I look at strings.h and line 47 is this:
void bzero(void *, size_t);
I've seen other people having trouble with this type of line because size_t is the wrong value. Some have fixed it by replacing size_t with the kernel's definition. My guess is that the order in which I'm including things is clobbering some definition that
I really need.
Here's a little background if people like the whole story:
I'm trying to buildAndroixusing
a slightly modified droid-wrapper]. I made a script (in my github repo as androix-buildscript) to build the whole shebang. It checks everything out and builds everything. Right now I'm having the following results:
-
Success: util/macros
-
Success: proto/xproto
-
Success: lib/libxtrans
-
Success: xcb/proto
-
Success: xcb/pthread-stubs
-
Failure: lib/libXau # strings.h error
-
Failure: xcb/libxcb # missing Xau
-
Success: proto/xextproto
-
Success: proto/kbproto
-
Success: proto/inputproto
-
Failure: lib/libX11 # missing libxcb
-
Failure: lib/libxkbfile # missing X11
-
Failure: app/xkbcomp # ./xkbparse.c... configure: error: cannot check for file existence when cross compiling make:*No
rule to make target `install'. Stop.
-
Success: xkeyboard-config
-
Success: mesa/drm
-
Success: proto/fixesproto
-
Success: proto/damageproto
-
Success: proto/xcmiscproto
-
Success: proto/bigreqsproto
-
Success: proto/compositeproto
-
Success: proto/recordproto
-
Success: proto/scrnsaverproto
-
Success: proto/resourceproto
-
Failure: freetype # still working on figuring out what the best way of building this would be, TODO
-
Success: lib/libfontenc
-
Failure: lib/libXfont # missing fontsproto, TODO
-
Failure: lib/libXdmcp # similar problem to strings.h libXau problem
-
Failure: pixman # different looking problem with 'Elf32_auxv_t', but may be the same as the strings.h problem with size_t. They are both DEFINE oriented problems.
Thanks for taking the time to check this out. I'm really stumped.
分享到:
相关推荐
android adt自带eclipse无法设置ndk路径,需要下载com.android.ide.eclipse.ndk_23.0.2.1259578.jar文件,然后复制到sdk 只带的eclipse目录的“plugins”下面,如我的复制到"D:\Android\adt-bundle-windows-x86_64-...
解决eclipse无NDK选项设置问题。复制到eclipse目录的“plugins”下面。如我的复制到"\eclipse\plugins\com.android.ide.eclipse.ndk_23.0.2.1259578.jar"
com.android.ide.eclipse.ndk_23.0.4.1468518.jar 解决eclipse无NDK选项设置问题。复制到eclipse目录的“plugins”下面。如我的复制到"\eclipse\plugins\com.android.ide.eclipse.ndk_23.0.4.1468518.jar" 然后重启...
解决Eclipse 无NDK 选项问题,将com.android.ide.eclipse.traceview_23.0.2.1259578.jar 包放到Eclipse ->plugins文件夹下!
android ndk android ndk android ndk android ndk android ndk android ndk
adt-bundle-windows-x86_64-20140702设置中没有NDK选项,只要将com.android.ide.eclipse.ndk_23.0.2.XXXX.jar com.android.ide.eclipse.ndk_23.0.4.XXXX.jar中的其中一个复制到plugins即可!
android-sdk-NDK16.1.4479499.rar
Android_NDK开发实例, 利用NDK生成SO库,使用SO库进行JNI调用,在Android sdcard创建文件并写入数据。
android 底层核心开发,使用NDK技术,样例,涉及c++ , java, linux
windows64位平台下编译ollvm6.0(集成了字符串混淆功能)生成的lib和bin文件,放在android-ndk-r18b-windows-x86_64\android-ndk-r18b\toolchains\llvm\prebuilt\windows-x86_64目录下面即可使用。(因为lib和bin...
下载NDK组件com.android.ide.eclipse.ndk_23.0.2.1259578.jar。将文件“com.android.ide.eclipse.ndk_23.0.2.1259578.jar”复制到sdk自带的eclipse/plugins目录下
android ndk开发 环境搭建以及具体事例
ndk-r19.0.5232133
关于Android NDK的文档。NDK是android平台通过C++编写软件的开发包,C/C++程序员在android平台开发软件可以看看。
Android.NDK.Beginners.Guide.2nd.Edition
通过 NDK ,android 应用可以开发使用C/C++程序
Android系统,使用NDK获取系统内存信息的代码
Unity3D 2019以上需要的ndk版本r19.0.5232133。
完美解决eclipse中Android选项中没有NDK设置的问题,按照教程来即可解决
Android_NDK_r5_ 安装于使用( windows)