windows build

Peter Kümmel syntheticpp at
Tue Jun 27 13:31:04 CEST 2006

Thiago Macieira wrote:
> Peter Kümmel wrote:
>> Thiago Macieira wrote:
>>> It looks like this is being caused by the KDE-side of things. Why
>>> should kauthorized.obj define the QList<QVariant>::isEmpty() and
>>> *export* it? That's an inline method defined in qlist.h.
>> Does it export it? kauthorized has its own instantiation and this one
>> conflicts with the instantiation exported by qdbus.
> Isn't this the only reason why it happens?
> If either symbol were not exported, there would be no conflict.

This fixes the linker error:

Index: kconfigbase.h
--- kconfigbase.h       (revision 555414)
+++ kconfigbase.h       (working copy)
@@ -34,6 +34,10 @@
 class Q3StrList;

+#ifdef Q_OS_WIN
+template class KDE_IMPORT QList<QVariant>;
 class KConfigBackEnd;
 class KConfigGroup;
 struct KEntry;

Maybe it is better to declare the export in dbus and
to include in kconfigbase.h the dbus header.

And the instantiation comes from:

template <typename T>
inline QList<T> KConfigBase::readEntry( const char* pKey, const QList<T>& aDefault) const
  QVariant::Type wanted = QVariant(T()).type();
    << "QString cannot convert to \"" << QVariant::typeToName(wanted)
    << "\" information will be lost" << endl;

  if (!hasKey(pKey))
    return aDefault;

  QList<QVariant> vList;

  if (!aDefault.isEmpty()) {
    foreach (T aValue, aDefault)
      vList.append( aValue );
  vList = readEntry( pKey, vList );

  QList<T> list;
  if (!vList.isEmpty()) {

Each call to this readEntry instantiates at least the ctor and dtor
of QList<QVariant>. I don't know a other solution than importing
the QList<QVariant> code.

More information about the Kde-buildsystem mailing list