building Solid
Dominik Haumann
dhaumann at kde.org
Wed Feb 26 12:51:52 UTC 2014
On Wednesday, February 26, 2014 07:52:21 Martin GräÃlin wrote:
> On Tuesday 25 February 2014 21:27:02 Dominik Haumann wrote:
> > On Tuesday 25 February 2014 20:34:38 Dominik Haumann wrote:
> > > Hi,
> > >
> > > a fresh Qt5 from stable branch, and a fresh frameworks build results in
> > > this error when building solid:
> > >
> > > $ make
> > > [ 0%] Automatic moc for target KF5Solid
> > > [ 0%] Built target KF5Solid_automoc
> > > [ 1%] Building CXX object
> > > src/solid/CMakeFiles/KF5Solid.dir/managerbase.cpp.o In file included
> > > from
> > > /home/dh/kde/kf5/src/frameworks/solid/src/solid/backends/udisks2/udisksm
> > > an
> > > a
> > > ger.h:25:0, from
> > > /home/dh/kde/kf5/src/frameworks/solid/src/solid/managerbase.cpp:35:
> > > /home/dh/kde/kf5/src/frameworks/solid/src/solid/backends/udisks2/udisks2
> > > .h
> > >
> > > 30:27: error: conflicting declaration âtypedef class QList<QByteArray>
> > > QByteArrayListâ typedef QList<QByteArray> QByteArrayList;
> > >
> > > ^
> > >
> > > In file included from
> > > /home/dh/kde/kf5/src/qt5/qtbase/include/QtCore/qbytearraylist.h:1:0,
> > > from
> > > /home/dh/kde/kf5/src/qt5/qtbase/include/QtCore/QtCore:119, from
> > > /home/dh/kde/kf5/src/qt5/qtbase/include/QtDBus/QtDBusDepends:2, from
> > > /home/dh/kde/kf5/src/qt5/qtbase/include/QtDBus/QtDBus:3, from
> > > /home/dh/kde/kf5/src/frameworks/solid/src/solid/backends/udisks2/udisks2
> > > .h
> > >
> > > 25, from
> > > /home/dh/kde/kf5/src/frameworks/solid/src/solid/backends/udisks2/udisksm
> > > an
> > > a
> > > ger.h:25, from
> > > /home/dh/kde/kf5/src/frameworks/solid/src/solid/managerbase.cpp:35:
> > > /home/dh/kde/kf5/src/qt5/qtbase/src/corelib/tools/qbytearraylist.h:56:7:
> > > error: âclass QByteArrayListâ has a previous declaration as âclass
> > > QByteArrayListâ class QByteArrayList : public QList<QByteArray>
> > >
> > > ^
> > >
> > > make[2]: *** [src/solid/CMakeFiles/KF5Solid.dir/managerbase.cpp.o] Error
> > > 1
> > > make[1]: *** [src/solid/CMakeFiles/KF5Solid.dir/all] Error 2
> > > make: *** [all] Error 2
> > >
> > > So QByteArrayList is once typedeffed in
> > > solid/backends/udisks2/udisks2.h,
> > > and once in QtCore/qbytearraylist.h Is that intention?
> >
> > https://qt.gitorious.org/qt/qtbase/source/4f23f0530a9c59400a7f3821cd2c9355
> > 80 1ed8cd:src/corelib/tools/qbytearraylist.cpp#L75 \since 5.3
>
> I showed that compile error to Alex last week and he mentioned that there is
> already some code under review to fix this issue. Alex, what's the status
> on that?
As workaround, one can add a #ifndef around the typedef as follows:
+ #ifndef QBYTEARRAYLIST_H
typedef QList<QByteArray> QByteArrayList;
+ #endif
That works, and one can at least compile.
The correct fix is probably to change it to
typedef QList<QByteArray> ByteArrayList;
adapt all all code parts that use this, and all is good.
Greetings,
Dominik
PS: It's never (!) a good idea to add a custom type that has Q* naming
style. It leads to totally unnecessary issues like this one ;)
More information about the Kde-frameworks-devel
mailing list