win32 build stops with linker error

Peter Kümmel syntheticpp at gmx.net
Tue Feb 7 23:05:35 CET 2006


David Faure wrote:
> 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.

I've tested it, but this doesn't help, like the error message indicates:
there is already a instantiation in kio.

Peter

> (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)
> 



More information about the Kde-buildsystem mailing list