[Chrono][System]:header only Boost.Chrono is not working with header only Boost.System
Hi,
On RHEL 5.5 Boost.Chrono 1.1.0 (Boost 1.47.0) fails to run in header only
mode with header only Boost.System.
This file can't be compiled:
#define BOOST_SYSTEM_NO_DEPRECATED // without it also error, but in
[Boost.System]
#define BOOST_SYSTEM_INLINED
#define BOOST_CHRONO_HEADER_ONLY
#include
Le 05/07/12 19:20, Dmitriy Matison a écrit :
Hi,
On RHEL 5.5 Boost.Chrono 1.1.0 (Boost 1.47.0) fails to run in header only mode with header only Boost.System.
This file can't be compiled:
#define BOOST_SYSTEM_NO_DEPRECATED // without it also error, but in [Boost.System] #define BOOST_SYSTEM_INLINED #define BOOST_CHRONO_HEADER_ONLY
#include
int main() { boost::chrono::steady_clock::time_point start = boost::chrono::steady_clock::now(); return 0; }
Error: In function `boost::chrono::steady_clock::now()': boost/chrono/detail/inlined/posix/chrono.hpp:85: undefined reference to `boost::system::system_category()'
Any comments from Chrono\System guys?
Hi, unfortunately the patch proposed to make Boost.System header only was not accepted. So even if Boost.Chrono is header-only it depends on a library that is not :( Best, Vicente
Hi Vicente:
Thanks for the fast response.
Then there is a bug in documentation:
http://www.boost.org/doc/libs/1_50_0/doc/html/chrono/users_guide.html
Building an Executable that Uses
Boost.Chronohttp://www.boost.org/doc/libs/1_50_0/doc/html/chrono/users_guide.html#chrono...
In addition to link with the *Boost.Chrono* library you need also to link
with the *Boost.System* library. Once *Boost.System* will be configurable
to be a header only using BOOST_SYSTEM_INLINED you will no need to link
with it.
Thanks,
Dmitriy.
On 6 July 2012 00:56, Vicente J. Botet Escriba
Le 05/07/12 19:20, Dmitriy Matison a écrit :
Hi,
On RHEL 5.5 Boost.Chrono 1.1.0 (Boost 1.47.0) fails to run in header only mode with header only Boost.System.
This file can't be compiled:
#define BOOST_SYSTEM_NO_DEPRECATED // without it also error, but in [Boost.System] #define BOOST_SYSTEM_INLINED #define BOOST_CHRONO_HEADER_ONLY
#include
int main() { boost::chrono::steady_clock::**time_point start = boost::chrono::steady_clock::**now(); return 0; }
Error: In function `boost::chrono::steady_clock::**now()': boost/chrono/detail/inlined/**posix/chrono.hpp:85: undefined reference to `boost::system::system_**category()'
Any comments from Chrono\System guys?
Hi,
unfortunately the patch proposed to make Boost.System header only was not accepted.
So even if Boost.Chrono is header-only it depends on a library that is not :(
Best, Vicente ______________________________**_________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/**mailman/listinfo.cgi/boost-**usershttp://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi, Dmitriy and Vicente
2012/7/6 Dmitriy Matison
Hi Vicente:
Thanks for the fast response. Then there is a bug in documentation: http://www.boost.org/doc/libs/1_50_0/doc/html/chrono/users_guide.html
Building an Executable that Uses Boost.Chrono
In addition to link with the Boost.Chrono library you need also to link with the Boost.System library. Once Boost.System will be configurable to be a header only using BOOST_SYSTEM_INLINED you will no need to link with it.
This is mistake "BOOST_ERROR_CODE_HEADER_ONLY" ?
======================== Akira Takahashi mailto:faithandbrave@gmail.com site : https://sites.google.com/site/faithandbrave/about/en
Le 06/07/12 10:38, Akira Takahashi a écrit :
Hi, Dmitriy and Vicente
2012/7/6 Dmitriy Matison
: Hi Vicente:
Thanks for the fast response. Then there is a bug in documentation: http://www.boost.org/doc/libs/1_50_0/doc/html/chrono/users_guide.html
Building an Executable that Uses Boost.Chrono
In addition to link with the Boost.Chrono library you need also to link with the Boost.System library. Once Boost.System will be configurable to be a header only using BOOST_SYSTEM_INLINED you will no need to link with it.
This is mistake "BOOST_ERROR_CODE_HEADER_ONLY" ?
I don't mind which macro should be used as far as it works and it is documented. Could point me where this macro is documented? Best, Vicente
Le 06/07/12 09:51, Dmitriy Matison a écrit :
Hi Vicente:
Thanks for the fast response. Then there is a bug in documentation: http://www.boost.org/doc/libs/1_50_0/doc/html/chrono/users_guide.html
Building an Executable that Uses Boost.Chrono http://www.boost.org/doc/libs/1_50_0/doc/html/chrono/users_guide.html#chrono...
In addition to link with the *Boost.Chrono* library you need also to link with the *Boost.System* library. Once *Boost.System* will be configurable to be a header only using |BOOST_SYSTEM_INLINED| you will no need to link with it.
Thanks, Dmitriy.
Why there is a bug? Vicente
Le 06/07/12 09:51, Dmitriy Matison a écrit :
Hi Vicente:
Thanks for the fast response. Then there is a bug in documentation: http://www.boost.org/doc/libs/1_50_0/doc/html/chrono/users_guide.html
Building an Executable that Uses Boost.Chrono http://www.boost.org/doc/libs/1_50_0/doc/html/chrono/users_guide.html#chrono...
In addition to link with the *Boost.Chrono* library you need also to link with the *Boost.System* library. Once *Boost.System* will be configurable to be a header only using |BOOST_SYSTEM_INLINED| you will no need to link with it.
Thanks, Dmitriy.
If you dont need the interfaces using error_code, could you try defining BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING? Best, Vicente
participants (3)
-
Akira Takahashi
-
Dmitriy Matison
-
Vicente J. Botet Escriba