title: Compile errors when including std::mutex before jemalloc.h
body: <p>This</p>
  
  <pre><code>//CSocket.h
  #ifndef __SERVER_CSOCKET_H__
  #define __SERVER_CSOCKET_H__
  
  #include "winsock2.h"
  #include "ws2tcpip.h"
  
  #include &lt;thread&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string&gt;
  </code></pre>
  
  <p>(cpp includes only the header)</p>
  
  <pre><code>//CSocket.cpp
  #include "CSocket.h"
  </code></pre>
  
  <p>produces the following error messages in c:\program files (x86)\microsoft visual studio 12.0\vc\include\ratio</p>
  
  <pre><code>ratio(122): error C2065: 'INTMAX_MAX': undeclared identifier
  ratio(133): See reference to the instance of the just compiled class-template "std::ratio&lt;_Nx,_Dx&gt;".
  ratio(124): error C2065: 'INTMAX_MAX': undeclared identifier
  ratio(44): error C2065: 'INTMAX_MAX': undeclared identifier
  ratio(217): See reference to the instance of the just compiled class-template "std::_Safe_mult&lt;0x01,0x01&gt;".
  ratio(36): error C2338: integer arithmetic overflow
  ratio(44): See reference to the instance of the just compiled class-template "std::_Safe_multX&lt;0x01,0x01,false&gt;".
  ratio(44): error C2039: 'value': Is not an element of 'std::_Safe_multX&lt;0x01,0x01,false&gt;'
  ratio(44): error C2065: 'value': undeclared identifier
  ratio(44): error C2057: Expected constant expression
  ratio(44): error C2039: 'value': Is not an element of 'std::_Safe_multX&lt;0x01,0x0989680,false&gt;'
  ratio(219): error C2975: "_Nx": invalid template argument for "std::ratio", expected compile-time constant expression.
  ratio(116): See declaration of '_Nx'
  ratio(219): error C2975: "_Dx": invalid template argument for "std::ratio", expected compile-time constant expression.
  ratio(117): See declaration of '_Dx'
  CSocket.cpp
  </code></pre>
  
  <p>Including std::thread in the .cpp and not in the header solves all errors but I don't know why it doesn't work in the header.</p>
  
  <pre><code>//CSocket.cpp
  #include "CSocket.h"
  #include &lt;thread&gt;
  </code></pre>
  
  <hr>
  
  <p>The only library I am using is jemalloc.
  Might the error come from including jemalloc.h before mutex not from thread itself?</p>