title: C++ AttachConsole include error
body: <p>How can I include AttachConsole? I always get "was not declared in this scope" error. </p>
  
  <p>I found this "To compile an application that uses this function, define _WIN32_WINNT as 0x0501 or later. For more information, see Using the Windows Headers." on Microsoft MSDN <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms681952%28v=vs.85%29.aspx" rel="nofollow">website</a>, but not working.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  #include &lt;windows.h&gt;
  
  #define _WIN32_WINNT 0x0502
  
  int main() {
      AttachConsole(8336);
  }
  </code></pre>