win32 build stops with linker error

David Faure faure at kde.org
Tue Feb 7 22:25:34 CET 2006


On Tuesday 07 February 2006 20:29, Christian Ehrlicher wrote:
> > kio.lib(kio.dll) : error LNK2005: "public: class QString & __thiscall QMap<class QString,class QString>::operator[](class QSt
> > ring const &)" (??A?$QMap at VQString@@V1@@@QAEAAVQString@@ABV1@@Z) already defined in khtml_printsettings.obj
> > kio.lib(kio.dll) : error LNK2005: "public: __thiscall QMap<class QString,class QString>::~QMap<class QString,class QString>(v
> > oid)" (??1?$QMap at VQString@@V1@@@QAE at XZ) already defined in khtml_settings.obj

Buuh :(

IIRC you need "template class QMap<QString,QString>;" in global.cpp
to force a template instantiation there, so that dependent libs don't do it themselves.
(No need for a win32 ifdef for that, it's fine for gcc too, it should even reduce
the number of symbols in the dependent libs).
We already have this in some places, like
kde3: kstandarddirs.cpp:template class QDict<QStringList>;
kde4: kapplication.cpp:template class QList<KSessionManaged*>;

> Don't export MetaData (It seems not to be used outside kio).

Depends how far you look....
http://lxr.kde.org/source/KDE/kdepim/kmail/imapaccountbase.cpp
058   using KIO::MetaData;
[...]
256   MetaData ImapAccountBase::slaveConfig() const {

(just one example. KIO::MetaData is definitely part of the public API)

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).



More information about the Kde-buildsystem mailing list