【问题标题】:zlib-1.2.11 configuration optionszlib-1.2.11 配置选项
【发布时间】:2017-03-27 12:08:25
【问题描述】:

从源代码编译 zlib 时-

./configure --help

显示没有任何信息的配置选项,所以我想知道是什么

--const and --zprefix 

用于。谢谢。

【问题讨论】:

  • 如果指定了--zprefix,zlib 1.2.11似乎无法构建。

标签: linux gcc zlib


【解决方案1】:

--const 为 zlib 函数的输入数组启用 const 关键字。这不是默认设置,因为它会破坏旧代码。对于新代码,使用const 提供的编译时检查是一个好处。

--zprefix 在所有外部符号前面加上z_,以降低大型应用程序中符号名称冲突的可能性。所以你会打电话给z_crc32()而不是crc32()

【讨论】:

  • 这是在哪里记录的?
  • --zprefix 在 zconf.h 中有一些隐藏文档:/* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */
  • --const 没有记录。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-07-11
  • 2021-10-05
  • 2010-12-26
  • 2023-03-11
  • 2016-09-10
  • 2015-10-13
  • 2014-08-20
相关资源
最近更新 更多