Results 1 to 2 of 2

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

  1. #1
    Join Date
    Jul 2015
    Posts
    26
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

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

    have a small qt class BUtils with export definition. It is defined in one module BMesh(dll) and can be compiled in the module BMesh without issue in VIsual Studio. Then I use BUtils in another module(dll) TBase. I added qt libraries, BMesh.lib and include paths in the
    properties of module TBase. I started to recompile TBase and got the linking error:

    .obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const BUtils::staticMetaObject

    I have another static variable defined in BUtils and got the following error:
    .obj : error LNK2001: unresolved external symbol "public: static bool BUtils::m_bStop"
    It seems only related to static definition. I have another nonstatic funcion and there is no error message to complains about
    that one. What is wrong? Thanks for your help

  2. #2
    Join Date
    Jul 2015
    Posts
    26
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

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

    forgot Using __declspec(dllimport). The problem is solved.

Similar Threads

  1. Replies: 13
    Last Post: 6th May 2019, 23:02
  2. Replies: 4
    Last Post: 9th May 2016, 12:30
  3. Replies: 1
    Last Post: 29th June 2013, 16:23
  4. Replies: 3
    Last Post: 17th March 2012, 09:31
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.