Boost C++ Libraries: Ticket #4856: compilation error: boost::local_time::local_microsec_clock::local_time() https://svn.boost.org/trac10/ticket/4856 <p> just simple call: boost::local_time::local_microsec_clock::local_time() </p> <p> produces compilation error: </p> <p> /usr/include/boost/date_time/microsec_time_clock.hpp:116: </p> <p> error: no matching function for call to </p> <p> 'boost::local_time::local_date_time_base&lt;boost::posix_time::ptime, boost::date_time::time_zone_base&lt;boost::posix_time::ptime, char&gt; </p> <blockquote class="citation"> <p> ::local_date_time_base(boost::gregorian::date&amp;, boost::posix_time::time_duration&amp;)' </p> </blockquote> <hr /> <p> platform ubuntu linux 10.10 x64 compiler: gcc 4.4.5 boost ver: 1.42 </p> <p> I have information from other party that the same problem occurs under MS Windows, with visual studio and boost 1.44 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4856 Trac 1.4.3 Katie Chan Tue, 30 Nov 2010 13:36:42 GMT <link>https://svn.boost.org/trac10/ticket/4856#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4856#comment:1</guid> <description> <p> Yes, this is a problem with Visual Studio as well. </p> <p> Note that the same bug occur when calling: </p> <pre class="wiki">boost::local_time::local_sec_clock::local_time(); </pre><pre class="wiki">1&gt;------ Build started: Project: test, Configuration: Debug Win32 ------ 1&gt;Build started 30/11/2010 12:59:54. 1&gt;InitializeBuildStatus: 1&gt; Touching "Debug\test.unsuccessfulbuild". 1&gt;ClCompile: 1&gt; test.cpp 1&gt;d:\libs\boost_1_45_0\boost\date_time\microsec_time_clock.hpp(116): error C2665: 'boost::local_time::local_date_time_base&lt;&gt;::local_date_time_base' : none of the 5 overloads could convert all the argument types 1&gt; d:\libs\boost_1_45_0\boost\date_time\local_time\local_date_time.hpp(81): could be 'boost::local_time::local_date_time_base&lt;&gt;::local_date_time_base(boost::posix_time::ptime,boost::shared_ptr&lt;T&gt;)' 1&gt; with 1&gt; [ 1&gt; T=boost::date_time::time_zone_base&lt;boost::posix_time::ptime,char&gt; 1&gt; ] 1&gt; d:\libs\boost_1_45_0\boost\date_time\local_time\local_date_time.hpp(220): or 'boost::local_time::local_date_time_base&lt;&gt;::local_date_time_base(const boost::date_time::special_values,boost::shared_ptr&lt;T&gt;)' 1&gt; with 1&gt; [ 1&gt; T=boost::date_time::time_zone_base&lt;boost::posix_time::ptime,char&gt; 1&gt; ] 1&gt; while trying to match the argument list '(boost::gregorian::date, boost::posix_time::time_duration)' 1&gt; d:\libs\boost_1_45_0\boost\date_time\microsec_time_clock.hpp(81) : while compiling class template member function 'boost::local_time::local_date_time boost::date_time::microsec_clock&lt;time_type&gt;::create_time(boost::date_time::microsec_clock&lt;time_type&gt;::time_converter)' 1&gt; with 1&gt; [ 1&gt; time_type=boost::local_time::local_date_time 1&gt; ] 1&gt; l:\users\ktc\documents\visual studio 2010\projects\date_time\test\test.cpp(30) : see reference to class template instantiation 'boost::date_time::microsec_clock&lt;time_type&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; time_type=boost::local_time::local_date_time 1&gt; ] 1&gt; 1&gt;Build FAILED. 1&gt; 1&gt;Time Elapsed 00:00:06.66 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== </pre> </description> <category>Ticket</category> </item> <item> <author>Manish Mulimani <manish.mulimani@…></author> <pubDate>Fri, 03 Jun 2011 09:32:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4856#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4856#comment:2</guid> <description> <p> It works with posix time: </p> <p> #include &lt;boost/date_time/posix_time/ptime.hpp&gt; </p> <p> #include &lt;boost/date_time/microsec_time_clock.hpp&gt; </p> <p> #include &lt;boost/date_time/local_time/local_time.hpp&gt; </p> <p> int main(int argc, char *argv[]) { </p> <blockquote> <p> std::cout &lt;&lt; boost::date_time::microsec_clock&lt;boost::posix_time::ptime&gt;::local_time() &lt;&lt; std::endl; return 0; </p> </blockquote> <p> } </p> <p> However as reported in bug, it does not work with local time. There is no overloaded constructor of boost::local_time::local_date_time_base, with following prototype: local_date_time_base(date_type,time_duration_type). </p> <p> There are 3 parameterized constructors defined: i&gt; local_date_time_base(utc_time_type, boost::shared_ptr&lt;tz_type&gt;) ii&gt; local_date_time_base(date_type, time_duration_type, boost::shared_ptr&lt;tz_type&gt;, bool) iii&gt; local_date_time_base(date_type, time_duration_type, boost::shared_ptr&lt;tz_type&gt;, DST_CALC_OPTIONS) </p> </description> <category>Ticket</category> </item> <item> <author>Manish Mulimani <manish.mulimani@…></author> <pubDate>Fri, 01 Jul 2011 10:53:52 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/4856#comment:3 https://svn.boost.org/trac10/ticket/4856#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">manish.mulimani@…</span> added </li> </ul> Ticket