使用 zlib 编译 boost

2023-10-17C/C++开发问题
23

本文介绍了使用 zlib 编译 boost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在 Windows 7 下用 bjam 编译 boost(64 位应该无关紧要)

I'm compiling boost with bjam under Windows 7 (64bit-should be irrelevant)

D:developmentoostoost_1_44libsiostreamsuild>bjam stage ^
--toolset=msvc-10.0 link=static ^
--build-type=complete ^
-s ZLIB_SOURCE=C:zlib125-dll ^
-s ZLIB_LIBPATH=C:zlib125-dlllib ^
-s ZLIB_INCLUDE=C:zlib125-dllinclude ^
-s ZLIB_BINARY=C:zlib125-dll

但我只得到

stage/libboost_iostreams-vc100-mt-gd-1_44.lib
bin.v2/libs/iostreams/build/msvc-10.0/debug/threading-multi/boost_iostreams-vc100-mt-gd-1_44.dll
bin.v2/libs/iostreams/build/msvc-10.0/debug/threading-multi/boost_iostreams-vc100-mt-gd-1_44.lib

bin.v2/libs/iostreams/build/zlib/msvc-10.0/debug/threading-multi/boost_zlib-vc100-mt-gd-1_44.dll
bin.v2/libs/iostreams/build/zlib/msvc-10.0/debug/threading-multi/boost_zlib-vc100-mt-gd-1_44.lib

但是 stage/libboost_zlib-vc100-mt-gd-1_44.lib 丢失了.

我编译错了吗?

当我尝试运行与 boost 和自编译的 boost/线程库配合良好的项目时,当我包含 boost zlib 内容时,出现以下错误

when I try running my project that worked well with boost and self-compiled boost/thread libraries I get the following error when I include the boost zlib stuff

6>LINK : fatal error LNK1104: cannot open file 'libboost_zlib-vc100-mt-gd-1_44.lib'

有人知道我做错了什么吗?

Does anyone know what I'm doing wrong?

推荐答案

我花了一段时间才让 Boost 在 zlib 支持下正确构建.

It took me a while to get Boost to build correctly with zlib support.

我遇到的问题是在某些时候 zlib 不再包含 gzio.c 源文件.Boost 构建系统 (jamfile.v2) 的 jamfile 引用了导致它失败的 gzio 模块.解决方案是在构建之前删除该引用.

The problem I ran into was that at some point zlib no longer included a gzio.c source file. The jamfile for the Boost build system (jamfile.v2) had a reference to the gzio module which caused it fail. The solution was to remove that reference before building.

我不确定这个答案是否不再相关,除非您正在尝试构建旧版本的 Boost.我相信最初的构建问题已在较新版本的 Boost 中得到修复.

I'm not sure this answer is relevant any longer, unless you're trying to build an old version of Boost. I believe the original build issue has been fixed in more recent versions of Boost.

这篇关于使用 zlib 编译 boost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6