Boost logo

Boost-Build :

Subject: [Boost-build] adding-lz to link commands
From: Gaurav Chakravorty (gchak_at_[hidden])
Date: 2013-07-19 11:53:06


Not sure why but after building boost with ZLIB_SOURCE set, the gcc.link
does not seem to have -lz in Bdynamic or Bstatic. I can't figure out what I
am missing.

# to build boost
cd /apps/boost/root/libs/iostreams/build/ ; b2 release debug
toolset=clang,gcc link=static --with-iostreams -s"BZIP2_SOURCE=/apps/bzip2"
-s"ZLIB_SOURCE=/apps/zlib" ; cd ../../system/build/ ; b2 release debug
toolset=clang,gcc link=static --with-system -s"BZIP2_SOURCE=/apps/bzip2"
-s"ZLIB_SOURCE=/apps/zlib" ; cd ../../filesystem/build/ ; b2 release debug
toolset=clang,gcc link=static --with-filesystem
-s"BZIP2_SOURCE=/apps/bzip2" -s"ZLIB_SOURCE=/apps/zlib" ; cd
../../program_options/build/ ; b2 release debug toolset=clang,gcc
link=static --with-program_options -s"BZIP2_SOURCE=/apps/bzip2"
-s"ZLIB_SOURCE=/apps/zlib" ; cd ../../date_time/build/ ; b2 release debug
toolset=clang,gcc link=static --with-date_time -s"BZIP2_SOURCE=/apps/bzip2"
-s"ZLIB_SOURCE=/apps/zlib" ;

# failed code build
gcc.link InitLogic/bin/gcc-4.7.2/release/link-static/sim_strategy
/apps/boost/root/bin.v2/libs/iostreams/build/gcc-4.7.2/release/link-static/libboost_iostreams.a(zlib.o):
In function `boost::iostreams::detail::zlib_base::after(char const*&,
char*&, bool)':
zlib.cpp:(.text+0x140): undefined reference to `crc32'
/apps/boost/root/bin.v2/libs/iostreams/build/gcc-4.7.2/release/link-static/libboost_iostreams.a(zlib.o):
In function `boost::iostreams::detail::zlib_base::reset(bool, bool)':
zlib.cpp:(.text+0x1d1): undefined reference to `deflateReset'
zlib.cpp:(.text+0x1e6): undefined reference to `inflateEnd'
zlib.cpp:(.text+0x1f9): undefined reference to `inflateReset'
zlib.cpp:(.text+0x211): undefined reference to `deflateEnd'
/apps/boost/root/bin.v2/libs/iostreams/build/gcc-4.7.2/release/link-static/libboost_iostreams.a(zlib.o):
In function
`boost::iostreams::detail::zlib_base::do_init(boost::iostreams::zlib_params
const&, bool, void* (*)(void*, unsigned int, unsigned int), void (*)(void*,
void*), void*)':
zlib.cpp:(.text+0x503): undefined reference to `inflateInit2_'
zlib.cpp:(.text+0x5a0): undefined reference to `deflateInit2_'
/apps/boost/root/bin.v2/libs/iostreams/build/gcc-4.7.2/release/link-static/libboost_iostreams.a(zlib.o):
In function `boost::iostreams::detail::zlib_base::xdeflate(int)':
zlib.cpp:(.text+0x1a4): undefined reference to `deflate'
/apps/boost/root/bin.v2/libs/iostreams/build/gcc-4.7.2/release/link-static/libboost_iostreams.a(zlib.o):
In function `boost::iostreams::detail::zlib_base::xinflate(int)':
zlib.cpp:(.text+0x1b4): undefined reference to `inflate'
collect2: error: ld returned 1 exit status

    "g++" -L"/apps/bzip2/lib" -L"/apps/zlib/lib" -o
"InitLogic/bin/gcc-4.7.2/release/link-static/sim_strategy"
-Wl,--start-group
"InitLogic/bin/gcc-4.7.2/release/link-static/sim_strategy.o"
"/home/gchak/basetrade_install/lib/liblinal.a"
"/home/gchak/basetrade_install/lib/libExecLogic.a"
"/home/gchak/basetrade_install/lib/libInitCommon.a"
"/home/gchak/basetrade_install/lib/libSimMarketMaker.a"
"/home/gchak/basetrade_install/lib/libSmartOrderRouting.a"
"/home/gchak/basetrade_install/lib/libModelMath.a"
"/home/gchak/basetrade_install/lib/libIndicators.a"
"/home/gchak/basetrade_install/lib/libVolatileTradingInfo.a"
"/home/gchak/basetrade_install/lib/libOrderRouting.a"
"/home/gchak/basetrade_install/lib/libMarketAdapter.a"
"/home/gchak/basetrade_install/lib/libMDSMessages.a"
"/home/gchak/basetrade_install/lib/libORSMessages.a"
"/home/gchak/basetrade_install/lib/libExternalData.a"
"/home/gchak/basetrade_install/lib/libProfiler.a"
"/home/gchak/basetrade_install/lib/libCommonTradeUtils.a"
"/home/gchak/basetrade_install/lib/libTradingInfo.a"
"/home/gchak/basetrade_install/lib/libCDef.a"
"/apps/boost/root/bin.v2/libs/iostreams/build/gcc-4.7.2/release/link-static/libboost_iostreams.a"
"/apps/boost/root/bin.v2/libs/filesystem/build/gcc-4.7.2/release/link-static/libboost_filesystem.a"
"/apps/boost/root/bin.v2/libs/system/build/gcc-4.7.2/release/link-static/libboost_system.a"
"/apps/boost/root/bin.v2/libs/date_time/build/gcc-4.7.2/release/link-static/libboost_date_time.a"
 -Wl,-Bstatic -lbz2 -Wl,-Bdynamic -Wl,--end-group

...failed gcc.link
InitLogic/bin/gcc-4.7.2/release/link-static/sim_strategy...
# reryunning command iwth -lz added after -lbz2 works, but can't get
boost.build to do that

Thanks,
gchak <
"humble debugger"
>



Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk