Results 1 to 6 of 6

Thread: qt creator linker errors LNK2019 and LNK2001

  1. #1
    Join Date
    Mar 2021
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default qt creator linker errors LNK2019 and LNK2001

    i try to build with qt5 and qt creator.
    get MANY linkererrors some LNK2019 like this:
    ...error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""class QLoggingCategory const & __cdecl statemachine(void)" (?statemachine@@YAAEBVQLoggingCategory@@XZ)" in Funktion ...

    and LNK2001:
    ... error LNK2001: Nicht aufgelöstes externes Symbol ""class QLoggingCategory const & __cdecl support(void)...

    please im new with qt. QLoggingCategory is part of core and core should be known ??

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qt creator linker errors LNK2019 and LNK2001

    It looks like you are using Microsoft Visual C++ as your build tool. Are you linking against a version of the Qt libraries that was built with this same tool chain (and same version of VC++), and not a Qt version built for minGW?

    Also, Qt is built with the flag "/Zc:wchar_t" ("Treat Wchar_t as a built-in type"). Be sure you build all code for your app with the same flag setting.
    <=== 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.

  3. #3
    Join Date
    Mar 2021
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qt creator linker errors 2001/2019

    thank you for answer. yes i use msvc. qt is opensourceversion. i want to produce opensourceapp. the name of kit i use is Desktop Qt 5.12.10 MSVC2017 64bit.

    i solved the qlogging-errors with comments cause i dont need the logs really.

    now i have other errors 2001/2019: Nicht aufgelöstes externes Symbol ""public: static struct QMetaObject ... whats that please?
    Last edited by Jan_qtuser; 30th March 2021 at 17:12.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qt creator linker errors 2001/2019

    QMetaObject linking errors are most likely due to not compiling or linking the automatically-generated moc_*.cpp file that is produced by the Qt MOC compiler.

    If you are using Qt Creator, you may need to re-run qmake.
    <=== 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.

  5. #5
    Join Date
    Mar 2021
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qt creator linker errors 2001/2019

    yes i use qt creator (but i tried with Visual Studio and QtTools too same result). i cleaned project, i deleted debug/release folder, rerun qmake (in menu build) again but always the same qmetaobject linkererrors. and all .obj and mocfiles seem to be there.

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qt creator linker errors 2001/2019

    Do you have a Q_OBJECT declaration in all classes deriving from QObject / QWidget?
    <=== 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: 5
    Last Post: 9th June 2011, 12:22
  2. Linker errors with Q_OBJECT
    By dustin034 in forum Qt Programming
    Replies: 2
    Last Post: 13th May 2010, 20:14
  3. please help with linker errors
    By jimboqt in forum Qt Programming
    Replies: 1
    Last Post: 5th July 2007, 10:49
  4. Linker errors!!
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2006, 09:14
  5. Linker Errors
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 7th March 2006, 19:30

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.