【发布时间】:2017-03-27 12:08:25
【问题描述】:
从源代码编译 zlib 时-
./configure --help
显示没有任何信息的配置选项,所以我想知道是什么
--const and --zprefix
用于。谢谢。
【问题讨论】:
-
如果指定了--zprefix,zlib 1.2.11似乎无法构建。
从源代码编译 zlib 时-
./configure --help
显示没有任何信息的配置选项,所以我想知道是什么
--const and --zprefix
用于。谢谢。
【问题讨论】:
--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 没有记录。