Reputation: 55690
When compiling my project I am getting a multiple definition of operator<<
error from the compiler.
inline QDataStream &operator<<(QDataStream &out, ValueCountPair const &pair)
{
out << pair.value() << pair.count();
return out;
}
I have checked and this specific operator is only declared and/or defined once in my entire code base. Why does it say that I have multiple definitions?
Upvotes: 3
Views: 1068
Reputation: 55690
Try doing this:
I had this same issue, and I assume that moc
somehow retained multiple copies of my code somewhere, causing the error. When you clean your project and rebuild it removes all the metacode created by the qmake
and moc
process, thus clearing the error.
This is a bug on the part of Qt.
Upvotes: 4