title: Including Q_OBJECT macro causes compiler errors when using VS add-in
body: <p>I am using the Visual Studio add-in to try to create a QT project in Visual Studio.  When I create a new class that uses the <code>Q_OBJECT</code> macro, I get compiler errors.  Removing the macro makes the errors disappear.  Here is an example header file.</p>
  
  <pre><code>#ifndef TELEVISION_H
  #define TELEVISION_H
  
  #include &lt;QObject&gt;
  #include &lt;Qt\qwidget.h&gt;
  #include &lt;Qt\qpainter.h&gt;
  
  class Television : public QWidget
  {
      //Q_OBJECT
  
  public:
      explicit Television(QWidget *parent = 0);
  }
  
  #endif
  </code></pre>
  
  <p>Uncommenting and re-commenting the <code>Q_OBJECT</code> line makes the compiler errors come and go.  The errors are all in <code>moc_television.cpp</code> (the auto-generated cpp file).  The errors don't seem helpful, for example:</p>
  
  <blockquote>
    <p>1>GeneratedFiles\Debug\moc_Television.cpp(20): error C2146: syntax
    error : missing ';' before identifier 'qt_meta_data_Television'</p>
  </blockquote>
  
  <p>Why is this happening and how can I fix it?</p>