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. Qt Remote Objects Compiler POD results in linker error
Forum Updated to NodeBB v4.3 + New Features

Qt Remote Objects Compiler POD results in linker error

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 280 Views
  • 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.
  • Q Offline
    Q Offline
    QKelteseth
    wrote on last edited by
    #1

    Hi all,

    my project has the following hierarchy:

    • Client
    • Common (regular app project (no aux) because otherwise it wont generate the *_replica and *_source files
      • Contains share libs and *.rep files
    • Server

    For the last month working with remote objects was greate but now I must synchronise a list of active users with custom members like username, profile picture etc. As stated in the documentation one should use the POD (Plain old data) for this, but generating even a simple example:

    #include <QString>
    #include <QList>
    
    POD Test(QList<QString> user)
    class ActiveSessionsList
    {
    
    };
    

    Results in:

    LNK2005: "public: static struct QMetaObject const Test::staticMetaObject [...] is already in moc_rep_activeSessionsList.obj defined (from moc_rep_activeSessionsList_source.obj)
    

    Any ideas?
    Compiled with Qt 5.12.0 MSVC2017 Windows 10

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      QKelteseth
      wrote on last edited by
      #2

      I now replaced the generation of REP files from the common project to a custom bat file which calls the compiler for all the Remote Objects. Because the staticMetaObject must be registered in the client and the server the error message makes sense because it will register both inside the same common project...

      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