在 Windows 上使用从源代码构建的 bzip2 增强 iostreams

发布于 2024-10-09 21:25:12 字数 545 浏览 7 评论 0原文

最近,我花了一些时间致力于在 Windows 上构建 boost 版本 1.44.0,同时支持 zlib 和 iostream。 bzip2 压缩过滤器。由于多种原因,决定允许 boost 构建 zlib 和 zlib 。来自源代码的 bzip2 库。对于它的价值,但我认为这并不重要,我使用的MSVC版本是VC9(VS2008)。另请注意,从我的粗浅检查来看,这个问题应该适用于 Windows 上针对 bzip2 构建的带有 iostreams 的任何版本的 boost。

通过指定 -sZLIB_SOURCE=-sBZIP2_SOURCE= 干净地构建Boost。但是,我们注意到 boost_iostreams*.dll 库依赖于 libbz2.dll(而不是 boost_bzip2*.dll),而后者并不存在。然而,Boost 确实成功构建了 boost_bzip2*.dll。请注意,我使用通配符作为所有构建变体信息的占位符。

问题:某处存在对 libbz2.dll 的硬编码依赖项。

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. For a variety of reasons, it was decided to allow boost to build both zlib & bzip2 libraries from source. For what it's worth, but I don't think it matters, the version of MSVC I'm using is 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.

Boost built cleanly by specifying -sZLIB_SOURCE=<PATH> and -sBZIP2_SOURCE=<PATH>. However, it was noticed that the boost_iostreams*.dll libs depended on libbz2.dll (instead of boost_bzip2*.dll), which did not exist. Boost, did however successfully build 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

围归者 2024-10-16 21:25:12

我发现的最简单的解决方案是修改 bzip2 源代码中包含的 libbz2.def 。即,删除该行(从 bzip2 v1.0.6 开始,为第 1 行):

LIBRARY   LIBBZ2

删除该行可消除对名为“libbz2.dll”的 DLL 的硬编码依赖性。然后,这允许名为 boost_bzip2*.dll 的 boost 构建的库以及生成的 *.lib 和 *.exp 文件正确解析为相应的 DLL,并导出所有必要的函数。

The simplest solution I found, was to modify libbz2.def included with the bzip2 source. Namely, delete the line (as of bzip2 v1.0.6, it is line 1):

LIBRARY   LIBBZ2

Removing this line eliminates the hard-coded dependency to a DLL named "libbz2.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文