title: C++11 chrono in visual studio 2013
body: <p>I am porting a code from Linux to Window.</p>
  
  <p>And There is a error i didn't expect in using std::chrono.</p>
  
  <p>since std::chrono is C++ standard library, i expected that it is working without modification.</p>
  
  <p>below is the code showing the error.</p>
  
  <p>the error happen at the parts where i use operator with duration instances and duration_cast function <code>with no instance of function template</code>.</p>
  
  <p>in Linux, the code works normally</p>
  
  <pre><code>std::string ChronoTimer::currentTime(){
      using namespace std::chrono;
      auto now = system_clock::now();
      time_point&lt;system_clock&gt; epoch;
  
      microseconds ms = duration_cast&lt;milliseconds&gt;(now - epoch);
  
      hours hour = duration_cast&lt;hours&gt;((ms % hours(24)) + hours(9));
      minutes min = duration_cast&lt;minutes&gt;(ms % hours(1));
      seconds sec = duration_cast&lt;seconds&gt;(ms % minutes(1));
      milliseconds msec = duration_cast&lt;milliseconds&gt;(ms % seconds(1));
  
  
      std::stringstream strStream;
      strStream &lt;&lt; std::setfill('0') &lt;&lt; std::setw(2) &lt;&lt; hour.count() &lt;&lt; ":";
      strStream &lt;&lt; std::setfill('0') &lt;&lt; std::setw(2) &lt;&lt; min.count() &lt;&lt; ":";
      strStream &lt;&lt; std::setfill('0') &lt;&lt; std::setw(2) &lt;&lt; sec.count() &lt;&lt; ".";
      strStream &lt;&lt; std::setfill('0') &lt;&lt; std::setw(3)&lt;&lt; msec.count();
      return strStream.str();
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/TsJp3.png" alt="enter image description here"></p>
  
  <pre><code>1   IntelliSense: no instance of function template "std::chrono::duration_cast" matches the argument list
          argument types are: (&lt;error-type&gt;)  
  
  
  2   IntelliSense: no operator "+" matches these operands
          operand types are: std::chrono::system_clock::rep + std::chrono::hours  
  
  3   IntelliSense: no instance of function template "std::chrono::duration_cast" matches the argument list
          argument types are: (std::chrono::system_clock::rep)    
  </code></pre>