简体   繁体   English

使用从Windows上的源代码构建的bzip2来增强iostream

[英]boost iostreams with bzip2 built from source on windows

Recently, I spent some time working on getting boost version 1.44.0 built on windows with both iostreams support for both zlib & bzip2 compression filters. 最近,我花了一些时间研究在Windows上构建的升级版本1.44.0,两个iostream都支持zlib和bzip2压缩过滤器。 For a variety of reasons, it was decided to allow boost to build both zlib & bzip2 libraries from source. 出于各种原因,决定允许boost从源代码构建zlib和bzip2库。 For what it's worth, but I don't think it matters, the version of MSVC I'm using is VC9 (VS2008). 对于它的价值,但我认为不重要,我使用的MSVC版本是VC9(VS2008)。 Also note that from my superficial examination, this issue should apply to any version of boost with iostreams built against bzip2 on windows. 另请注意,从我的肤浅检查来看,这个问题应该适用于在Windows上针对bzip2构建的iostreams的任何版本的boost。

Boost built cleanly by specifying -sZLIB_SOURCE=<PATH> and -sBZIP2_SOURCE=<PATH> . 通过指定-sZLIB_SOURCE=<PATH>-sBZIP2_SOURCE=<PATH>-sZLIB_SOURCE=<PATH>构建Boost。 However, it was noticed that the boost_iostreams*.dll libs depended on libbz2.dll (instead of boost_bzip2*.dll), which did not exist. 但是,有人注意到boost_iostreams * .dll库取决于libbz2.dll(而不是boost_bzip2 * .dll),它不存在。 Boost, did however successfully build boost_bzip2*.dll. 然而,Boost成功构建了boost_bzip2 * .dll。 Note that I'm using the wildcard as a placeholder for the all of the build variant information. 请注意,我使用通配符作为所有构建变体信息的占位符。

Problem: Somewhere a hard-coded dependency to libbz2.dll exists. 问题:某处存在对libbz2.dll的硬编码依赖。

The simplest solution I found, was to modify libbz2.def included with the bzip2 source. 我发现最简单的解决方案是修改bzip2源中包含的libbz2.def。 Namely, delete the line (as of bzip2 v1.0.6, it is line 1): 即删除该行(从bzip2 v1.0.6开始,它是第1行):

LIBRARY   LIBBZ2

Removing this line eliminates the hard-coded dependency to a DLL named "libbz2.dll". 删除此行消除了对名为“libbz2.dll”的DLL的硬编码依赖性。 This then allows the boost-built libs named boost_bzip2*.dll and generated *.lib and *.exp files to properly resolve to the corresponding DLL, as well as export all necessary functions. 然后,这允许名为boost_bzip2 * .dll的boost-built libs和生成的* .lib和* .exp文件正确解析为相应的DLL,以及导出所有必需的函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM