Android NDK字符串错误。h,可能是由于size_t的错误。

时间:2021-12-22 16:05:59

I'm having problems with building X11 for Android using the NDK. I'm using the latest NDK with droid-wrapper. I've updated droid-wrapper to 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:

我在使用NDK为Android构建X11时遇到了一些问题。我用的是最新的NDK。我已经更新了droid-wrapper来处理我正在构建的大多数东西,但是它实际上只是添加了一些编译器选项。我已经打印出了下面使用的选项。我已经走得很远了,但是我遇到了这个问题,建立了一些图书馆:

 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:

我看着字符串。h和第47行是这样的

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.

我看到其他的人在这种类型的线上有麻烦,因为size_t是错误的值。一些人通过将size_t替换为内核的定义来修复它。我的猜测是,我所包含的东西的顺序是我真正需要的定义。

Here's a little background if people like the whole story:

这里有一个小背景,如果人们喜欢整个故事:

I'm trying to build Androix using 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:

我试着用一个稍微修改过的滴管来制造Androix。我制作了一个脚本(在我的github repo中作为androix-buildscript)来构建整个shebang。它会检查所有的东西并构建一切。现在我得到了如下结果:

  • Success: util/macros
  • 成功:util /宏
  • Success: proto/xproto
  • 成功:原型/ xproto
  • Success: lib/libxtrans
  • 成功:lib / libxtrans
  • Success: xcb/proto
  • 成功:xcb /原型
  • Success: xcb/pthread-stubs
  • 成功:xcb / pthread-stubs
  • Failure: lib/libXau # strings.h error
  • 失败:lib / libXau #字符串。h错误
  • Failure: xcb/libxcb # missing Xau
  • 失败:xcb/libxcb #丢失的Xau。
  • Success: proto/xextproto
  • 成功:原型/ xextproto
  • Success: proto/kbproto
  • 成功:原型/ kbproto
  • Success: proto/inputproto
  • 成功:原型/ inputproto
  • Failure: lib/libX11 # missing libxcb
  • 失败:lib/libX11 #丢失libxcb。
  • Failure: lib/libxkbfile # missing X11
  • 失败:lib/libxkbfile #丢失X11。
  • Failure: app/xkbcomp # ./xkbparse.c... configure: error: cannot check for file existence when cross compiling make: * No rule to make target `install'. Stop.
  • 失败:app / xkbcomp #。/ xkbparse.c……配置:错误:在交叉编译时不能检查文件是否存在:*没有规则来设置目标“安装”。停止。
  • Success: xkeyboard-config
  • 成功:xkeyboard-config
  • Success: mesa/drm
  • 成功:台面/ drm
  • Success: proto/fixesproto
  • 成功:原型/ fixesproto
  • Success: proto/damageproto
  • 成功:原型/ damageproto
  • Success: proto/xcmiscproto
  • 成功:原型/ xcmiscproto
  • Success: proto/bigreqsproto
  • 成功:原型/ bigreqsproto
  • Success: proto/compositeproto
  • 成功:原型/ compositeproto
  • Success: proto/recordproto
  • 成功:原型/ recordproto
  • Success: proto/scrnsaverproto
  • 成功:原型/ scrnsaverproto
  • Success: proto/resourceproto
  • 成功:原型/ resourceproto
  • Failure: freetype # still working on figuring out what the best way of building this would be, TODO
  • 失败:freetype #仍在努力找出最好的建造方法是什么,TODO。
  • Success: lib/libfontenc
  • 成功:lib / libfontenc
  • Failure: lib/libXfont # missing fontsproto, TODO
  • 失败:lib/libXfont # missing fontsproto, TODO。
  • Failure: lib/libXdmcp # similar problem to strings.h libXau problem
  • 失败:lib/libXdmcp与字符串类似的问题。h libXau问题
  • 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.
  • 失败:pixman #不同的查找问题与'Elf32_auxv_t',但可能是相同的字符串。size_t h问题。它们都定义了面向对象的问题。

Thanks for taking the time to check this out. I'm really stumped.

谢谢你抽空来看看。我真的难住了。

1 个解决方案

#1


0  

I managed to finish the make by commenting the lines in strings.h that showed error. Also I used memset in AuDispose.c instead of bzero.

我通过注释字符串中的行来完成make。h显示错误。我还在AuDispose中使用了memset。c而不是bzero。

#1


0  

I managed to finish the make by commenting the lines in strings.h that showed error. Also I used memset in AuDispose.c instead of bzero.

我通过注释字符串中的行来完成make。h显示错误。我还在AuDispose中使用了memset。c而不是bzero。