Results 1 to 4 of 4

Thread: moc link error

  1. #1
    Join Date
    Apr 2012
    Location
    France
    Posts
    13

    Exclamation moc link error

    Hi all,

    I am developing a huge application that use a lot of different components in separate dll
    each component have its own namespace.

    when I use the following exemple of code I have many link errors

    namespace FIRST
    {
    class MyClass : public QObject
    {
    Q_OBJECT
    ...
    }
    }

    namespace SECOND
    {
    class MyClass : public QObject
    {
    Q_OBJECT
    ...
    }
    }

    then while linking using the generated moc files, the link is messed up and SECOND::MyClass try to link with FIRST::MyClass.

    Is that a limitation of the moc process as we can't use same class name in different namespaces ?

    Thank you in advance for your answers
    zal

  2. #2
    Join Date
    Feb 2011
    Location
    Bangalore
    Posts
    207
    Thanks
    20
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: moc link error

    No there is no such limitation.

  3. #3
    Join Date
    Apr 2012
    Location
    France
    Posts
    13

    Default Re: moc link error

    By the way, I am using the QT Plugin with MSVC 2008. Maybe this is a configuration problem ?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: moc link error

    Maybe we would have some idea if you shared that actual error messages or a self-contained example program that demonstrates the problem. There are 2 gajillion ways you can write a broken program and we don't know which apply.

Similar Threads

  1. Qt4 with MySQLon Win XP link error
    By FumblesMacStupid in forum Newbie
    Replies: 0
    Last Post: 7th May 2011, 19:17
  2. Replies: 11
    Last Post: 5th May 2011, 14:05
  3. Link error
    By emrares in forum Qt Programming
    Replies: 1
    Last Post: 12th November 2010, 13:45
  4. link error on QMetaObject
    By itmwa in forum Qt Programming
    Replies: 0
    Last Post: 15th October 2008, 10:58
  5. moc link error
    By user_mail07 in forum Qt Programming
    Replies: 3
    Last Post: 3rd July 2007, 19:30

Tags for this Thread

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.