Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtDBus linkage error

QtDBus linkage error

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ilyasivkov
    wrote on last edited by
    #1

    Hi,
    I built Qt on Windows with WinDBus. Qt itself built OK, but QDbus examples build fails with message

    moc_car_adaptor_p.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDBusAbstractAdaptor::staticMetaObject" (?staticMetaObject@QDBusAbstractAdaptor@@2UQMetaObject@@B)

    Folder E:\qt\4.6.4\msvc2008\lib contains QtDBus4.dll QtDBus4.lib QtDBusd4.dll and QtDBusd4.lib. All contains 'staticMetaObject@QDBusAbstractAdaptor@@2UQMetaObject@@B' string.

    How to fix it?

    Beforehand thankful, Ilya.

    1 Reply Last reply
    0
    • I Offline
      I Offline
      ilyasivkov
      wrote on last edited by
      #2

      The problem was in qdbusmacros.h:
      @#if defined(QDBUS_MAKEDLL)

      define QDBUS_EXPORT Q_DECL_EXPORT

      #elif defined(QT_SHARED)

      define QDBUS_EXPORT Q_DECL_IMPORT

      #else

      define QDBUS_EXPORT

      #endif
      @

      QT_SHARED was not declared in application, and QDBUS_EXPORT becames nothing.

      Adding
      @CONFIG += QT_SHARED

      @

      solved the problem.

      Note: in Qt 4.8.4 all works fine (previously I used 4.6.4)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved