unixman83
unixman83

Reputation: 9933

Boost requires compiled libraries like libboost_date_time for even basic things. How do I eliminate dependencies on building those libraries?

I want a header-only BOOST.

Using boost::bind and boost::ptr_set, it seems unnecessary to depend on libboost_date_time and libboost_regex. But I get a linker error for those libraries when I build.

LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc90-mt-s-1_47.lib'

Upvotes: 3

Views: 3560

Answers (3)

GrafikRobot
GrafikRobot

Reputation: 3059

Geenrally you can #define BOOST_ALL_NO_LIB to disable the auto-linking of the MSVC compiler you are using as documented (see Boost.Config). But of course you still have to compile and link the libraries you do use. Which if you are getting those errors it means that you are likely using the libraries.

Upvotes: 4

unixman83
unixman83

Reputation: 9933

#define BOOST_DATE_TIME_NO_LIB in your compiler Makefile to exclude the datetime library. #define BOOST_REGEX_NO_LIB to exclude the regex library, for example.

Upvotes: 4

Nicol Bolas
Nicol Bolas

Reputation: 473537

You can use the bcp utility to copy the specific portions of Boost that you actually use.

Upvotes: 2

Related Questions