Problem compiling QTBus binding on win32

Ralf Habacker ralf.habacker at freenet.de
Sat May 6 01:13:36 PDT 2006


Hi all,

currently I'm trying to compile the Qt DBus binding on windows using gcc 
3.4.5 and QT 4.1.2 (the last official qt release) and have problems with 
some Q_FOREACH statements:

c:\mingw\bin\g++.exe   -IC:\Daten\kde4\dbus-till2 
-IC:\Daten\kde4\dbus-till-build -IC:\Qt\4.1.2\include 
-IC:\Qt\4.1.2\include\Qt -IC:\Qt\4.1
.2\mkspecs\default -IC:\Qt\4.1.2\include\QtCore 
-IC:\Qt\4.1.2\include\QtGui -IC:\Qt\4.1.2\include\Qt3Support 
-IC:\Qt\4.1.2\include\QtAssista
nt -IC:\Qt\4.1.2\include\QtDesigner -IC:\Qt\4.1.2\include\QtNetwork 
-IC:\Qt\4.1.2\include\QtOpenGL -IC:\Qt\4.1.2\include\QtSql -IC:\Qt\4.1.2
\include\QtXml -IC:\Qt\4.1.2\include\QtSvg -IC:\Qt\4.1.2\include\QtTest 
-IC:\Daten\kde4\dbus-till2\dbus   -DQT_DLL -DHAVE_CONFIG_H=1 -DDBUS_
API_SUBJECT_TO_CHANGE -DDBUS_COMPILATION -DDBUS_ENABLE_VERBOSE_MODE=1 
-DDBUS_BUILD_TESTS=1 -g -DQT_DLL -DQDBUS_MAKEDLL -o qt/CMakeFiles/libd
bus-qt4.dir/qdbusbus.obj -c C:\Daten\kde4\dbus-till2\qt\qdbusbus.cpp
In file included from 
C:\Daten\kde4\dbus-till2\qt\qdbusabstractinterface.h:34,
                 from C:\Daten\kde4\dbus-till2\qt\qdbusbus.h:37,
                 from C:\Daten\kde4\dbus-till2\qt\qdbusbus.cpp:32:
C:/Qt/4.1.2/include/QtCore/../../src/corelib/global/qglobal.h: In 
instantiation of `QForeachContainer<const QVariantList&>':
C:\Daten\kde4\dbus-till2\qt\qdbustypehelper_p.h:138:   instantiated from 
here
C:/Qt/4.1.2/include/QtCore/../../src/corelib/global/qglobal.h:1579: 
error: forming reference to reference type `const QVariantList&'
C:/Qt/4.1.2/include/QtCore/../../src/corelib/global/qglobal.h:1582: 
error: `const QVariantList&' is not a class, struct, or union type
C:/Qt/4.1.2/include/QtCore/../../src/corelib/global/qglobal.h:1582: 
error: `const QVariantList&' is not a class, struct, or union type
C:\Daten\kde4\dbus-till2\qt\qdbustypehelper_p.h: In static member 
function `static QList<T> QDBusTypeHelper<T>::fromVariantList(const 
QVariantList&)':
C:\Daten\kde4\dbus-till2\qt\qdbustypehelper_p.h:138: error: 'class 
QForeachContainer<const QVariantList&>' has no member named 'i'
C:\Daten\kde4\dbus-till2\qt\qdbustypehelper_p.h:138: error: 'class 
QForeachContainer<const QVariantList&>' has no member named 'e'
C:\Daten\kde4\dbus-till2\qt\qdbustypehelper_p.h:138: error: 'class 
QForeachContainer<const QVariantList&>' has no member named 'i'
C:\Daten\kde4\dbus-till2\qt\qdbustypehelper_p.h:138: error: 'class 
QForeachContainer<const QVariantList&>' has no member named 'i'
mingw32-make[2]: *** [qt/CMakeFiles/libdbus-qt4.dir/qdbusbus.obj] Error 1
mingw32-make[2]: Leaving directory `C:/Daten/kde4/dbus-till-build'
mingw32-make[1]: *** [qt/CMakeFiles/libdbus-qt4.dir/all] Error 2
mingw32-make[1]: Leaving directory `C:/Daten/kde4/dbus-till-build'
mingw32-make: *** [all] Error 2


the related part in qdbustypehelper_p.h ist listed below:

static inline List fromVariantList(const QVariantList &list)
    {
        List tmp;
        Q_FOREACH (const QVariant &v, list)
            tmp.append(fromVariant(v));
        return tmp;
    }

A similar problem occurs in qdbusintegrator.cpp with the typ QObjectList:

"Building CXX object qt/CMakeFiles/libdbus-qt4.dir/qdbusintegrator.obj"
c:\mingw\bin\g++.exe   -IC:\Daten\kde4\dbus-till2 
-IC:\Daten\kde4\dbus-till-build -IC:\Qt\4.1.2\include 
-IC:\Qt\4.1.2\include\Qt -IC:\Qt\4.1
.2\mkspecs\default -IC:\Qt\4.1.2\include\QtCore 
-IC:\Qt\4.1.2\include\QtGui -IC:\Qt\4.1.2\include\Qt3Support 
-IC:\Qt\4.1.2\include\QtAssista
nt -IC:\Qt\4.1.2\include\QtDesigner -IC:\Qt\4.1.2\include\QtNetwork 
-IC:\Qt\4.1.2\include\QtOpenGL -IC:\Qt\4.1.2\include\QtSql -IC:\Qt\4.1.2
\include\QtXml -IC:\Qt\4.1.2\include\QtSvg -IC:\Qt\4.1.2\include\QtTest 
-IC:\Daten\kde4\dbus-till2\dbus   -DQT_DLL -DHAVE_CONFIG_H=1 -DDBUS_
API_SUBJECT_TO_CHANGE -DDBUS_COMPILATION -DDBUS_ENABLE_VERBOSE_MODE=1 
-DDBUS_BUILD_TESTS=1 -g -DQT_DLL -DQDBUS_MAKEDLL -o qt/CMakeFiles/libd
bus-qt4.dir/qdbusintegrator.obj -c 
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp
In file included from C:/Qt/4.1.2/include/Qt/qdebug.h:1,
                 from C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp:27:
C:/Qt/4.1.2/include/Qt/../../src/corelib/io/qdebug.h:146: warning: 
inline function `QDebug qDebug()' declared as dllimport: attribute ignored
C:/Qt/4.1.2/include/Qt/../../src/corelib/io/qdebug.h:147: warning: 
inline function `QDebug qWarning()' declared as dllimport: attribute ignored
C:/Qt/4.1.2/include/Qt/../../src/corelib/io/qdebug.h:148: warning: 
inline function `QDebug qCritical()' declared as dllimport: attribute 
ignored
C:/Qt/4.1.2/include/QtCore/../../src/corelib/global/qglobal.h: In 
instantiation of `QForeachContainer<const QObjectList&>':
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp:1104:   instantiated 
from here
C:/Qt/4.1.2/include/QtCore/../../src/corelib/global/qglobal.h:1579: 
error: forming reference to reference type `const QObjectList&'
C:/Qt/4.1.2/include/QtCore/../../src/corelib/global/qglobal.h:1582: 
error: `const QObjectList&' is not a class, struct, or union type
C:/Qt/4.1.2/include/QtCore/../../src/corelib/global/qglobal.h:1582: 
error: `const QObjectList&' is not a class, struct, or union type
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp: In function `bool 
applyForObject(QDBusConnectionPrivate::ObjectTreeNode*, const QString&, 
Func&)':
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp:1104: error: 'class 
QForeachContainer<const QObjectList&>' has no member named 'i'
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp:1104: error: 'class 
QForeachContainer<const QObjectList&>' has no member named 'e'
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp:1104: error: 'class 
QForeachContainer<const QObjectList&>' has no member named 'i'
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp:1104: error: 'class 
QForeachContainer<const QObjectList&>' has no member named 'i'
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp: In function `bool 
applyForObject(QDBusConnectionPrivate::ObjectTreeNode*, const QString&, 
Func&) [with Func = qdbus_activateObject]':
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp:1140:   instantiated 
from here
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp:1104: error: no matching 
function for call to `QForeachContainer<const 
QObjectList&>::QForeachContainer(const QList<QObject*>&)'
C:/Qt/4.1.2/include/QtCore/../../src/corelib/global/qglobal.h:1577: 
note: candidates are: QForeachContainer<const 
QObjectList&>::QForeachContainer(const QForeachContainer<const 
QObjectList&>&)
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp: In function `bool 
applyForObject(QDBusConnectionPrivate::ObjectTreeNode*, const QString&, 
Func&) [with Func = qdbus_Introspect]':
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp:1570:   instantiated 
from here
C:\Daten\kde4\dbus-till2\qt\qdbusintegrator.cpp:1104: error: no matching 
function for call to `QForeachContainer<const 
QObjectList&>::QForeachContainer(const QList<QObject*>&)'
C:/Qt/4.1.2/include/QtCore/../../src/corelib/global/qglobal.h:1577: 
note: candidates are: QForeachContainer<const 
QObjectList&>::QForeachContainer(const QForeachContainer<const 
QObjectList&>&)
mingw32-make[2]: *** [qt/CMakeFiles/libdbus-qt4.dir/qdbusintegrator.obj] 
Error 1
mingw32-make[2]: Leaving directory `C:/Daten/kde4/dbus-till-build'
mingw32-make[1]: *** [qt/CMakeFiles/libdbus-qt4.dir/all] Error 2
mingw32-make[1]: Leaving directory `C:/Daten/kde4/dbus-till-build'
mingw32-make: *** [all] Error 2


qdbusintegrator.cpp:1100
            const QObjectList &children = obj->children();

            // find a child with the proper name
            QObject *next = 0;
            foreach (QObject *child, children)
                if (child->objectName() == path.at(i)) {
                    next = child;
                    break;
                }


Any idea what's going wrong or is the qt bus binding not compilable with 
qt 4.1.2  ?

Regards
Ralf



More information about the dbus mailing list