Le 04/05/2016 06:05, Edward Diener a écrit :
The documentation for chrono says:
"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. "
So I have:
#define BOOST_CHRONO_HEADER_ONLY #define BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING #include
followed by some code using chrono, and I still get when linking my exe:
gcc.link C:\Programming\VersionControl\modular-boost\build\boost\bin.v2\libs\cxx_dual\test\test_chrono.test\gcc-mingw-5.3\debug\test_chrono.exe C:\Programming\VersionControl\modular-boost\build\boost\bin.v2\libs\cxx_dual\test\test_chrono.test\gcc-mingw-5.3\debug\test_chrono.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
Is there a way to use chrono without having to link boost::system ?
Hi,
Please fill a Trac ticket so that I don't forget to check this.
Coud you try to replace in boost/chrono/detail/system.hpp:
#include