0

I'm trying to build the latest version of the QMF from the Git sources on OS X 10.6 but I keep running into this error:

"QPrivatelyImplemented<QMailMessageBodyPrivate>::~QPrivatelyImplemented()", referenced from:
  QMailMessageBody::~QMailMessageBody()in qmfstoragemanager.o
  QMailMessageBody::~QMailMessageBody()in qmfstoragemanager.o
  PartStorer::operator()(QMailMessagePart const&)in qmfstoragemanager.o
  PartLoader::operator()(QMailMessagePart&)in qmfstoragemanager.o
 "QPrivatelyImplemented<QMailMessageHeaderFieldPrivate>::~QPrivatelyImplemented()", referenced from:
  QMailMessageContentType::~QMailMessageContentType()in qmfstoragemanager.o
  QMailMessageContentType::~QMailMessageContentType()in qmfstoragemanager.o
  ReferenceLoader::operator()(QMailMessagePart&)in qmfstoragemanager.o
  PartLoader::operator()(QMailMessagePart&)in qmfstoragemanager.o
"QPrivatelyImplemented<QMailMessagePartContainerPrivate>::~QPrivatelyImplemented()", referenced from:
  QMailMessage::~QMailMessage()in qmfstoragemanager.o
"QPrivatelyImplemented<QMailMessageMetaDataPrivate>::~QPrivatelyImplemented()", referenced from:
  QMailMessage::~QMailMessage()in qmfstoragemanager.o
 "QPrivatelyImplemented<QMailMessageMetaDataPrivate>::operator=(QPrivatelyImplemented<QMailMessageMetaDataPrivate> const&)", referenced from:
  QmfStorageManager::load(QString const&, QMailMessage*) in qmfstoragemanager.o
"QPrivatelyImplemented<QMailMessagePartContainerPrivate>::operator=(QPrivatelyImplemented<QMailMessagePartContainerPrivate> const&)", referenced from:
  QmfStorageManager::load(QString const&, QMailMessage*) in qmfstoragemanager.o
ld: symbol(s) not found for architecture x86_64

It does, however, compile flawlessly under Ubuntu and I'm near enough positive I've compiled it on OS X previous so I'm a bit puzzled, obvious symbols not found generally means there's some source code missing, anyone come across this before I start tearing it apart?

Nicholas Smith
  • 11,642
  • 6
  • 37
  • 55
  • "ld: symbol(s) not found for architecture x86_64" This looks fishy to me. Are you linking against the appropriate libraries (if any are needed)? [This link](http://qt-project.org/forums/viewthread/5665) may also be relevant. – Eli Hooten Jun 20 '12 at 00:47
  • It could be something in my build of Qt being screwy, but generally when you leave out a method definition it'll throw the same warning. – Nicholas Smith Jun 20 '12 at 09:33

1 Answers1

1

This error occurs because compiler omits unreferenced classes away from the library. I was able to workaround this issue by adding the following code after all the explicit template instantiations (or just add it to the end of file) in src\libraries\qmfclient\qmailinstantiations.cpp:

class reference_holder
{
    struct helper
    {
        helper(QPrivatelyImplemented<QMailMessageBodyPrivate>* = 0)
        {
        }

        ~helper()
        {
        }
    };

    static helper helper_;

    static void use_helper()
    {
        (void)helper_;
    }

    template<void(*)()>
    struct helper2 {};

    static helper2<&reference_holder::use_helper> helper2_;
};
Anton Matosov
  • 1,685
  • 1
  • 20
  • 19