开发者

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

开发者 https://www.devze.com 2023-04-10 04:58 出处:网络
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 librarie

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'


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.


#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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消