Opened 10 years ago

Closed 10 years ago

#7185 closed Bugs (fixed)

Header only chrono requires library

Reported by: DanSearles@… Owned by: viboes
Milestone: Boost 1.51.0 Component: chrono
Version: Boost 1.50.0 Severity: Problem
Keywords: Cc:

Description

Documentation for including chrono.hpp: http://www.boost.org/doc/libs/1_50_0/doc/html/chrono/users_guide.html

implies that chrono can be configured as a 'header only library', by defining BOOST_CHRONO_HEADER_ONLY, but on VC9, I get a link error: cannot open file 'libboost_system-vc90-mt-gd-1_50.lib

Adding a define for BOOST_ALL_NO_LIB results in two undefined objects: class boost::system::error_category const & cdecl boost::system::generic_category(void) class boost::system::error_category const & cdecl boost::system::system_category(void)

Change History (8)

comment:1 by DanSearles@…, 10 years ago

Added a define for less documented BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING, but still get the generic_category and system_category undefines

in reply to:  1 comment:2 by viboes, 10 years ago

Replying to DanSearles@…:

Added a define for less documented BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING, but still get the generic_category and system_category undefines

The macro is documented here http://www.boost.org/doc/libs/1_50_0/doc/html/chrono/reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.conf.

Please could you tell me which .cpp file has the undefined symbols?

comment:3 by viboes, 10 years ago

There is another possibility, please could you try BOOST_ERROR_CODE_HEADER_ONLY?

comment:4 by viboes, 10 years ago

Status: newassigned

comment:5 by DanSearles@…, 10 years ago

I tried adding #define BOOST_ERROR_CODE_HEADER_ONLY and was able to compile and build without linker errors. The 'Fix' appears to be to just mention in the docs these needed defines, for the chrono header only version.

comment:6 by DanSearles@…, 10 years ago

So the final set that worked was: #define BOOST_ERROR_CODE_HEADER_ONLY #define BOOST_ALL_NO_LIB #define BOOST_CHRONO_HEADER_ONLY #define BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING

comment:7 by viboes, 10 years ago

Milestone: To Be DeterminedBoost 1.51.0

Committed in trunk revision 80043.

comment:8 by viboes, 10 years ago

Resolution: fixed
Status: assignedclosed

Committed revision 80044.

Note: See TracTickets for help on using tickets.