Results 1 to 14 of 14

Thread: error LNK2001: unresolved external symbol "public: static struct QMetaObject

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,329
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: error LNK2001: unresolved external symbol "public: static struct QMetaObject

    I think this error typically occurs because MOC hasn't run to generate its moc_*.cpp files, or if it has, the .cpp files have not been compiled or the resulting .obj files have not been included in the link. Try doing a clean rebuild. Also make sure that you have declared Q_OBJECT in and classes that inherit from QObject.

    You could also look at your .vcproj file. You should see entries such as this:

    Qt Code:
    1. <FileConfiguration Name="Debug|Win32">
    2. <Tool
    3. Name="VCCustomBuildTool"
    4. Description="Moc&apos;ing $(InputFileName)..."
    5. CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -D_UNICODE -DQT_CORE_LIB -DQT_GUI_LIB -DQT_LARGEFILE_SUPPORT -DQT_THREAD_SUPPORT -DSACOREQT_LIB -DUNICODE -DWIN32 -DXERCES_STATIC_LIBRARY -I&quot;$(QTDIR)\include&quot; -I&quot;$(QTDIR)\include\ActiveQt&quot; -I&quot;$(QTDIR)\include\QtCore&quot; -I&quot;$(QTDIR)\include\QtGui&quot; -I&quot;.&quot; -I&quot;.\..\Include&quot; -I&quot;.\GeneratedFiles&quot; -I&quot;.\GeneratedFiles\$(ConfigurationName)&quot;&#x0D;&#x0A;"
    6. AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
    7. Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
    8. />
    9. </FileConfiguration>
    To copy to clipboard, switch view to plain text mode 
    Last edited by d_stranz; 11th August 2012 at 19:28.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 4
    Last Post: 9th May 2016, 12:30
  2. error LNK2001: unresolved external symbol _IID_ID3DXEffec tStateManager
    By Tusharsankhala in forum Installation and Deployment
    Replies: 0
    Last Post: 16th May 2012, 18:16
  3. Replies: 3
    Last Post: 17th March 2012, 09:31
  4. Replies: 4
    Last Post: 5th January 2011, 15:51
  5. Replies: 16
    Last Post: 23rd May 2008, 10:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.