title: Native types, critical section and handles not defined in c++ program
body: <p>I have a compilation problem that I just can't explain in a c++ program on Visual Studio 2012. The error appears at several places in the program, here is an example:</p>
  
  <pre><code>#ifndef     __WINMUTEX_H__
  # define    __WINMUTEX_H__
  # ifdef _WIN32
  # include   &lt;windows.h&gt;
  
  namespace Thread
  {
  class       WinMutex
  {
  public:
      WinMutex();
      ~WinMutex();
      void    lock();
      void    unlock();
      bool    trylock();
  private:
      CRITICAL_SECTION    _mutex;
  };
  
  typedef WinMutex Mutex;
  }
  # endif
  #endif
  </code></pre>
  
  <p>The compiler gives me an error (C2146). Basically the compiler doesn't seem to find the CRITICAL_SECTION identifier, neither does the Intellisense. As I said, this error occurs in several parts of the program and not just for CRITICAL_SECTION but also for HANDLE and even DWORD.</p>
  
  <p>I tried replacing the windows.h include with the windows 8 equivalent (synchapi.h) but then I still get the error with the addition of the "No target architecture" error.</p>
  
  <p>What's weird is that this code works when I used it in a project on visual studio 2010 on Windows 7.</p>
  
  <p>Anyone knows why this is happening?</p>
  
  <p>Thanks</p>