title: Unresolved symbols QMetaObject when building OpenCV with QT support
body: <p>I have problems on building OpenCV_HighGui220d.lib with QT support. 
  The problems are the unresolved symbols about <strong>QMetaObject</strong>, such as:</p>
  
  <pre><code>    public: virtual struct QMetaObject const * __thiscall GuiReceiver::metaObject(void)const (?metaObject@GuiReceiver@@UBEPBUQMetaObject@@XZ)
  </code></pre>
  
  <p><strong>My Environments</strong>:<br/>
   - Visual Studio 2010<br/>
   - OpenCV 2.2<br/>
   - QT SDK Version:4.7.3<br/></p>
  
  <p>Below are my building steps:<br/>
  1. use CMake to open <code>C:\OpenCV2.2</code>, check on <strong>WITH_QT</strong> and <strong>WITH_QT_OPENGL</strong>, generate vcxproj and sln files.<br/><br/>2. add below macros in <code>cvconfig.h</code>:
  <pre><code><code>#define HAVE_QT</code>
  <code>#define HAVE_QT_OPENGL</code></code></pre><br/>3. add window_QT.cpp into opencv_highgui.vcxproj file in VS2010, and add below macros in window_QT.cpp
  <pre><code><code>#define QT_LARGEFILE_SUPPORT</code>
  <code>#define QT_DLL</code>
  <code>#define QT_GUI_LIB</code>
  <code>#define QT_CORE_LIB</code>
  <code>#define QT_HAVE_MMX</code>
  <code>#define QT_HAVE_3DNOW</code>
  <code>#define QT_HAVE_SSE</code>
  <code>#define QT_HAVE_MMXEXT</code>
  <code>#define QT_HAVE_SSE2</code>
  <code>#define QT_THREAD_SUPPORT</code></code></pre> I also tried to replace <strong>QT_DLL</strong> with <strong>QT_NODLL</strong>, but did not succeed.<br/><br/> 4. Add directory <code>C:/QtSDK/Desktop/Qt/4.7.3/msvc2008/lib</code> in Additional Library Directories in Linker Property pages.<br/><br/> 5. Add below libraries in Additional Dependencies:
  <pre><code>qtmain.lib
  qtmaind.lib
  QtGui4.lib
  QtGuid4.lib
  QtCore4.lib
  QtCored4.lib
  QtOpenGL4.lib
  QtOpenGLd4.lib
  Qt3Support4.lib
  Qt3Supportd4.lib
  QtHelp4.lib
  QtHelpd4.lib
  QtDesigner4.lib
  QtDesignerd4.lib
  QAxContainer.lib
  QAxContainerd.lib
  phonon4.lib
  phonond4.lib
  QAxServer.lib
  QAxServerd.lib
  QtDeclarative4.lib
  QtDeclaratived4.lib
  QtDesignerComponents4.lib
  QtDesignerComponentsd4.lib
  QtMultimedia4.lib
  QtMultimediad4.lib
  QtNetwork4.lib
  QtNetworkd4.lib
  QtScript4.lib
  QtScriptd4.lib
  QtScriptTools4.lib
  QtScriptToolsd4.lib
  QtSql4.lib
  QtSqld4.lib
  QtSvg4.lib
  QtSvgd4.lib
  QtTest4.lib
  QtTestd4.lib
  QtUiTools.lib
  QtUiToolsd.lib
  QtWebKit4.lib
  QtWebKitd4.lib
  QtXml4.lib
  QtXmld4.lib
  QtXmlPatterns4.lib
  QtXmlPatternsd4.lib</code></pre><br/> 6. Finally, the linker reports error:</p>
  
  <pre><code>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
  ------ Build started: Project: opencv_highgui, Configuration: Debug Win32 ------
       Creating library C:/OpenCV2.2/Build_QT/lib/Debug/opencv_highgui220d.lib and object C:/OpenCV2.2/Build_QT/lib/Debug/opencv_highgui220d.exp
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall GuiReceiver::metaObject(void)const " (?metaObject@GuiReceiver@@UBEPBUQMetaObject@@XZ)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall GuiReceiver::qt_metacast(char const *)" (?qt_metacast@GuiReceiver@@UAEPAXPBD@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall GuiReceiver::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@GuiReceiver@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CvTrackbar::metaObject(void)const " (?metaObject@CvTrackbar@@UBEPBUQMetaObject@@XZ)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall CvTrackbar::qt_metacast(char const *)" (?qt_metacast@CvTrackbar@@UAEPAXPBD@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CvTrackbar::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@CvTrackbar@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const CvTrackbar::staticMetaObject" (?staticMetaObject@CvTrackbar@@2UQMetaObject@@B)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CvButtonbar::metaObject(void)const " (?metaObject@CvButtonbar@@UBEPBUQMetaObject@@XZ)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall CvButtonbar::qt_metacast(char const *)" (?qt_metacast@CvButtonbar@@UAEPAXPBD@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CvButtonbar::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@CvButtonbar@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const CvButtonbar::staticMetaObject" (?staticMetaObject@CvButtonbar@@2UQMetaObject@@B)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CvPushButton::metaObject(void)const " (?metaObject@CvPushButton@@UBEPBUQMetaObject@@XZ)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall CvPushButton::qt_metacast(char const *)" (?qt_metacast@CvPushButton@@UAEPAXPBD@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CvPushButton::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@CvPushButton@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CvCheckBox::metaObject(void)const " (?metaObject@CvCheckBox@@UBEPBUQMetaObject@@XZ)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall CvCheckBox::qt_metacast(char const *)" (?qt_metacast@CvCheckBox@@UAEPAXPBD@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CvCheckBox::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@CvCheckBox@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CvRadioButton::metaObject(void)const " (?metaObject@CvRadioButton@@UBEPBUQMetaObject@@XZ)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall CvRadioButton::qt_metacast(char const *)" (?qt_metacast@CvRadioButton@@UAEPAXPBD@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CvRadioButton::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@CvRadioButton@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CvWinProperties::metaObject(void)const " (?metaObject@CvWinProperties@@UBEPBUQMetaObject@@XZ)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall CvWinProperties::qt_metacast(char const *)" (?qt_metacast@CvWinProperties@@UAEPAXPBD@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CvWinProperties::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@CvWinProperties@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CvWindow::metaObject(void)const " (?metaObject@CvWindow@@UBEPBUQMetaObject@@XZ)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall CvWindow::qt_metacast(char const *)" (?qt_metacast@CvWindow@@UAEPAXPBD@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CvWindow::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@CvWindow@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const CvWindow::staticMetaObject" (?staticMetaObject@CvWindow@@2UQMetaObject@@B)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall ViewPort::metaObject(void)const " (?metaObject@ViewPort@@UBEPBUQMetaObject@@XZ)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall ViewPort::qt_metacast(char const *)" (?qt_metacast@ViewPort@@UAEPAXPBD@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall ViewPort::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@ViewPort@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
  window_QT.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const ViewPort::staticMetaObject" (?staticMetaObject@ViewPort@@2UQMetaObject@@B)
  C:\OpenCV2.2\Build_QT\bin\Debug\opencv_highgui220d.dll : fatal error LNK1120: 31 unresolved externals
  ========== Build: 1 succeeded, 1 failed, 8 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p></p>