win32 build stops with linker error
Peter Kümmel
syntheticpp at gmx.net
Tue Jun 27 16:03:51 CEST 2006
Peter Kümmel wrote:
> David Faure wrote:
>> On Tuesday 07 February 2006 23:05, Peter Kümmel wrote:
>>> 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.
>> I just saw something similar in another project here.
>> It seems that the explicit instantiation should be in the .h, not in the .cpp,
>> and with dlllimport.
>> Hmm, that's what you tried first, but try with s/extern template/template class/ ?
>>
>> Please don't change the base class, we would have to redefine the whole QMap API...
>>
>
> #ifdef Q_OS_WIN
> template class __declspec(dllexport) QMap<QString, QString>;
> #endif
>
> Does the job.
> Peter
Maybe we could also fix this error by including kio/kio/global.h at the
right place in khtml.
But currently the build system is broken on win2k, because moc is
called with too much parameters thus the command line becomes too long.
Peter
More information about the Kde-buildsystem
mailing list