Alex Rivera | Logout

Compiling boost with zlib

Asked 2011-02-08T19:59:50.893
16

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

D:\development\boost\boost_1_44\libs\iostreams\build>bjam stage ^
--toolset=msvc-10.0 link=static ^
--build-type=complete ^
-s ZLIB_SOURCE=C:\zlib125-dll ^
-s ZLIB_LIBPATH=C:\zlib125-dll\lib ^
-s ZLIB_INCLUDE=C:\zlib125-dll\include ^
-s ZLIB_BINARY=C:\zlib125-dll

But I only get

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

but stage/libboost_zlib-vc100-mt-gd-1_44.lib is missing.

Am I compiling something wrong?

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?

Edit
Report

1 Answer

3

I had the same problem (Windows 7 Visual Studio) and I believe the issue is not in how you build boost.

1) As ecotax, there should not be a space after the -s 2) When running bjam, add the flag --debug-configuration. If in the output you do not see errors and it prints out something like

notice: iostreams: using prebuilt zlib

then it has found your zlib copy, which it is good.

3) Notice that the library libboost_zlib-vc100-mt-gd-1_44.lib should not be produced.

4) When you compile your application in Visual Studio, seems that Boost.Iostreams auto-linking still wants libboost_zlib-vc100-mt-gd-1_44.lib and reports a link error.

What it worked for me (I founded googling) was to add to the preprocessor definitions the flag

BOOST_IOSTREAMS_NO_LIB

answered 2012-09-19T15:07:31.483

Your Answer