id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 12176,Chrono without linking to Boost.System,Edward Diener,viboes,"In the chrono docs we have: {{{ How to Build Boost.Chrono as a Header Only Library? When BOOST_CHRONO_HEADER_ONLY is defined the lib is header-only. If in addition BOOST_USE_WINDOWS_H is defined is included, otherwise files in boost/detail/win are used to reduce the impact of including . However, you will either need to define BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING or link with Boost.System. }}} But when I followed this chrono still linked with Boost.System. Here is the code: {{{ #define BOOST_CHRONO_HEADER_ONLY #define BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING // #define BOOST_SYSTEM_NO_DEPRECATED #include #include #include int main() { typedef boost::chrono::duration > shakes; typedef boost::chrono::duration jiffies; typedef boost::chrono::duration > microfortnights; typedef boost::chrono::duration > nanocenturies; boost::chrono::seconds sec(1); std::cout << ""1 second is:\n""; std::cout << boost::chrono::duration_cast(sec).count() << "" shakes\n""; std::cout << boost::chrono::duration_cast(sec).count() << "" jiffies\n""; std::cout << microfortnights(sec).count() << "" microfortnights\n""; std::cout << nanocenturies(sec).count() << "" nanocenturies\n""; return 0; } }}} The link error message is: {{{ gcc.link C:\Programming\VersionControl\modular-boost\build\boost\bin.v2\libs\cxx_dual\test\test_chrono_boost.test\gcc-mingw-5.3\debug\test_chrono_boost.exe C:\Programming\VersionControl\modular-boost\build\boost\bin.v2\libs\cxx_dual\test\test_chrono_boost.test\gcc-mingw-5.3\debug\test_chrono_boost.o: In function `_static_initialization_and_destruction_0': E:\Programming\VersionControl\modular-boost\libs\cxx_dual\test/../../../boost/system/error_code.hpp:221: undefined reference to `boost::system::generic_category()' E:\Programming\VersionControl\modular-boost\libs\cxx_dual\test/../../../boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()' E:\Programming\VersionControl\modular-boost\libs\cxx_dual\test/../../../boost/system/error_code.hpp:223: undefined reference to `boost::system::system_category()' collect2.exe: error: ld returned 1 exit status }}} If I uncomment the line: {{{ // #define BOOST_SYSTEM_NO_DEPRECATED }}} then chrono links without requiring Boost.System. Maybe this bug is one of documentation and the documentation should be changed to specify that BOOST_SYSTEM_NO_DEPRECATED must also be defined in order to remove the chrono dependency on Boost.System. ",Bugs,closed,Boost 1.62.0,chrono,Boost 1.61.0,Problem,fixed,,