0

当我想交叉构建libz时,出现错误,我用谷歌搜索,但找不到答案。请帮助我。我也找到了一个网站,但我不能很好地理解这一点。 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=444727

编码:

root@ubuntu:/home/topeet/Desktop/zlib-1.2.5# make
arm-linux-ar libz.a adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o 
arm-linux-ar: illegal option -- z
Usage: arm-linux-ar [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...
       arm-linux-ar -M [<mri-script]
 commands:
  d            - delete file(s) from the archive
  m[ab]        - move file(s) in the archive
  p            - print file(s) found in the archive
  q[f]         - quick append file(s) to the archive
  r[ab][f][u]  - replace existing or insert new file(s) into the archive
  t            - display contents of archive
  x[o]         - extract file(s) from the archive
 command specific modifiers:
  [a]          - put file(s) after [member-name]
  [b]          - put file(s) before [member-name] (same as [i])
  [N]          - use instance [count] of name
  [f]          - truncate inserted file names
  [P]          - use full path names when matching
  [o]          - preserve original dates
  [u]          - only replace files that are newer than current archive contents
 generic modifiers:
  [c]          - do not warn if the library had to be created
  [s]          - create an archive index (cf. ranlib)
  [S]          - do not build a symbol table
  [v]          - be verbose
  [V]          - display the version number
  @<file>      - read options from <file>
 emulation options: 
  No emulation specific options
arm-linux-ar: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big srec symbolsrec tekhex binary ihex
make: *** [libz.a] Error 1
4

1 回答 1

1

我认为这是 arm-linux-ar 的错误。我不知道参数“--z”在哪里。

但是我们可以自己链接:(添加选项'rcs')

arm-linux-ar rcs libz.a adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o 

之后,进行安装。

于 2016-09-20T02:07:46.303 回答