title: "error C2653: System is not a class or a namespace name" in Form header file, Visual C++
body: <p>My previous questions concerning the same project: <a href="https://stackoverflow.com/questions/15758851/unresolved-external-sybol-in-referenced-library-visual-c">one</a> and <a href="https://stackoverflow.com/questions/15761567/how-reference-a-lib-file-native-c-in-a-visual-c-project">two</a>. It's not necessary to read them; just know that I am trying to use a native C++ SDK in a Visual C++ project. This is much trickier than I had initially thought, but this website about <a href="http://msmvps.com/blogs/vandooren/archive/2008/09/03/extending-a-native-c-project-with-managed-code.aspx" rel="nofollow noreferrer">Extending a native C++ project with managed code</a> has helped me a lot further already.</p>
  
  <p>As per that last link's instructions, I have added a Form to my native C++ project, which has automatically converted the project to a CLR one. Only <code>MainForm.cpp</code> and <code>Interface.cpp</code> (the file that allows native C++ code to create and show a MainForm) are compiled with the <code>/clr</code> flag though; the other files remain native. </p>
  
  <p>The problem I have now, is that Visual Studio doesn't seem to recognise any of the CLR stuff that's being used in <code>MainForm.h</code>. As such, in the following lines:</p>
  
  <pre><code>using namespace System;
  using namespace System::ComponentModel;
  using namespace System::Collections;
  using namespace System::Windows::Forms;
  using namespace System::Data;
  using namespace System::Drawing;
  </code></pre>
  
  <p>the word <code>System</code> is always underlined in red, with according errors:</p>
  
  <pre><code>error C2653: 'System' is not a class or a namespace name
  </code></pre>
  
  <p>for each of those lines.</p>
  
  <p>It also does not recognise the word <code>gcnew</code> and other things that should work effortlessly inside CLR.</p>
  
  <p>Can anybody tell me what I might be doing wrong? My guess is that it's something very small; some flag I have forgotten to change, a missing reference or something similar, but I just can't figure out what it is.</p>