PDA

View Full Version : moc link error



Zalwou06
12th September 2012, 15:00
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

pkj
12th September 2012, 15:11
No there is no such limitation.

Zalwou06
12th September 2012, 15:26
By the way, I am using the QT Plugin with MSVC 2008. Maybe this is a configuration problem ?

ChrisW67
13th September 2012, 03:03
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.