简体   繁体   English

使用bzip增强iostream-未解析的符号

[英]Boost iostreams with bzip - unresolved symbols

My project was using an older version of Boost's iostreams w/ bzip2. 我的项目使用的是带有bzip2的Boost的iostream的旧版本。 I'm now trying to upgrade to Boost 1.51. 我现在正尝试升级到Boost 1.51。 At first I did not compile with bzip so obviously I got the linker yelling about libboost_bzip2-vc100-mt-sgd-1_51.lib being missing. 最初,我没有使用bzip进行编译,因此显然链接器大喊libboost_bzip2-vc100-mt-sgd-1_51.lib丢失了。 I then followed these instructions (and added the static flag) to compile this file. 然后,我按照这些说明进行操作 (并添加了静态标志)来编译该文件。

However, running the linker now returns a bunch of symbols missing: 但是,运行链接器现在会返回缺少的一堆符号:

>error LNK2001: unresolved external symbol "protected: __thiscall boost::iostreams::detail::bzip2_base::~bzip2_base(void)" (??1bzip2_base@detail@iostreams@boost@@IAE@XZ)
>error LNK2001: unresolved external symbol "protected: __thiscall boost::iostreams::detail::bzip2_base::bzip2_base(struct boost::iostreams::bzip2_params const &)" (??0bzip2_base@detail@iostreams@boost@@IAE@ABUbzip2_params@23@@Z)
>error LNK2001: unresolved external symbol "int const boost::iostreams::bzip2::stream_end" (?stream_end@bzip2@iostreams@boost@@3HB)
...

Any ideas how come the lib doesn't contain all this code? 任何想法,为什么lib不包含所有这些代码? What am I missing? 我想念什么? I'm using VS2010 on Windows. 我在Windows上使用VS2010。


Edit: Got it! 编辑:知道了!

Had an old version of libboost_iostreams-vc100-mt-sgd-1_51.lib that was compiled without the bzip. 具有旧版本的libboost_iostreams-vc100-mt-sgd-1_51.lib,该版本未经bzip编译。 What I'm still not sure about is this: For my original compilation I used: 我仍然不确定的是:对于我的原始编译,我使用了:

>b2 --with-iostreams -sBZIP2_SOURCE=D:\Work\external\bzip2-1.0.6 -sZLIB_SOURCE=d:\work\external\zlib-1.2.3 runtime-link=static

This produced the following files: 这产生了以下文件:

libboost_bzip2-vc100-mt-s-1_51.lib
libboost_bzip2-vc100-mt-sgd-1_51.lib

For the "correct" compilation (that solved the problem) I used: 对于“正确”的编译(解决了问题),我使用了:

>b2 --with-iostreams -sBZIP2_SOURCE=D:\Work\external\bzip2-1.0.6 runtime-link=static

Ie simply removed the zlib, as it was unnecessary for me. 即简单地删除了zlib,因为对我而言这是不必要的。 It produced: 它产生了:

libboost_bzip2-vc100-mt-s-1_51.lib
libboost_bzip2-vc100-mt-sgd-1_51.lib
libboost_iostreams-vc100-mt-s-1_51.lib
libboost_iostreams-vc100-mt-sgd-1_51.lib

How come the iostreams libs were not produced on the original compilation? iostreams libs为什么不是在原始编译中生成的? Very odd. 很奇怪。

Thanks. 谢谢。

From EK's answer-in-question: 从EK的提问中:

Had an old version of libboost_iostreams-vc100-mt-sgd-1_51.lib that was compiled without the bzip. 具有旧版本的libboost_iostreams-vc100-mt-sgd-1_51.lib,该版本未经bzip编译。 What I'm still not sure about is this: For my original compilation I used: 我仍然不确定的是:对于我的原始编译,我使用了:

>b2 --with-iostreams -sBZIP2_SOURCE=D:\Work\external\bzip2-1.0.6 -sZLIB_SOURCE=d:\work\external\zlib-1.2.3 runtime-link=static

This produced the following files: 这产生了以下文件:

libboost_bzip2-vc100-mt-s-1_51.lib
libboost_bzip2-vc100-mt-sgd-1_51.lib

For the "correct" compilation (that solved the problem) I used: 对于“正确”的编译(解决了问题),我使用了:

>b2 --with-iostreams -sBZIP2_SOURCE=D:\Work\external\bzip2-1.0.6 runtime-link=static

Ie simply removed the zlib, as it was unnecessary for me. 即简单地删除了zlib,因为对我而言这是不必要的。 It produced: 它产生了:

libboost_bzip2-vc100-mt-s-1_51.lib
libboost_bzip2-vc100-mt-sgd-1_51.lib
libboost_iostreams-vc100-mt-s-1_51.lib
libboost_iostreams-vc100-mt-sgd-1_51.lib

How come the iostreams libs were not produced on the original compilation? iostreams libs为什么不是在原始编译中生成的? Very odd. 很奇怪。

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

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