title: Can't compile with time- and clock-related functions C++
body: <p>I starting <a href="https://github.com/FoxEmu/FoxEmu" rel="nofollow">my first GNU project</a> based on <a href="https://github.com/Elyotna/IntWars" rel="nofollow">another GNU project</a> to improve upon it and change the implementation.</p>
  
  <p>I tried to implement my own build method, but time- and clock-related functions broke my build.</p>
  
  <p>I've read a lot of questions on Stack Overflow, but I very confused with the three libraries <code>chrono</code>, <code>ctime</code> and <code>time.h</code>.</p>
  
  <p>This is the build errors:</p>
  
  <p><strong>/src/gamed/Logger.cpp</strong></p>
  
  <pre><code>#include "Logger.h"
  #include &lt;errno.h&gt;
  #include &lt;string.h&gt;
  
  #include &lt;stdarg.h&gt;
  
  #include &lt;time.h&gt;
  
  const std::string Logger::CurrentDateTime()
  {
      time_t     now = time(0);
      struct tm  tstruct;
      char       buf[80];
      tstruct = *localtime(&amp;now);
      strftime(buf, sizeof(buf), "%Y-%m-%d %X", &amp;tstruct);
  
      return buf;
  }
  </code></pre>
  
  <p>Error: time, localtime and strftime identifier not found</p>
  
  <p><strong>/src/gamed/Packets.h</strong></p>
  
  <pre><code>#ifndef _PACKETS_H
  #define _PACKETS_H
  
  #include &lt;time.h&gt;
  #include &lt;cmath&gt;
  #include &lt;set&gt;
  
  {...}
  
  class GamePacket : public BasePacket {
  
  public:
     GamePacket(uint8 cmd = 0, uint32 netId = 0) : BasePacket(cmd, netId) {
        buffer &lt;&lt; (uint32)clock();
     }
  
  };
  </code></pre>
  
  <blockquote>
    <p>Error: clock identifier not found</p>
  </blockquote>
  
  <p><strong>/src/gamed/Pathfinder.cpp</strong></p>
  
  <pre><code>#include "Logger.h"
  #include "Pathfinder.h"
  #include "Map.h"
  #include "AIMesh.h"
  #include &lt;algorithm&gt;
  #include &lt;cstring&gt;
  #include &lt;cstdio&gt;
  #include &lt;cstdlib&gt;
  #include &lt;chrono&gt;
  #include "Logger.h"
  #include "Minion.h"
  #include "Champion.h"
  
  Map * Pathfinder::chart = 0;
  auto g_Clock = std::clock();
  </code></pre>
  
  <blockquote>
    <p>Error: clock isn't member of std</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>