Bug 364407 - Doesn't build with Qt 5.7
Summary: Doesn't build with Qt 5.7
Status: RESOLVED FIXED
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Guillaume DE BURE
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-17 05:51 UTC by Antonio Rojas
Modified: 2016-07-04 21:57 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
fix build with Qt 5.7 (6.76 KB, patch)
2016-07-03 18:23 UTC, Olivier Pena
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Rojas 2016-06-17 05:51:12 UTC
skrooge 2.4 doesn't build against Qt 5.7:

[ 24%] Building CXX object skgsqlcipher/CMakeFiles/libskgsqlcipher.dir/qsql_sqlite.cpp.o
[ 24%] Building CXX object skgsqlcipher/CMakeFiles/libskgsqlcipher.dir/libskgsqlcipher_automoc.cpp.o
/build/skrooge/src/skrooge-2.4.0/skgsqlcipher/qsql_sqlite.cpp: In constructor 'QSQLiteResult::QSQLiteResult(const QSQLiteDriver*)':
/build/skrooge/src/skrooge-2.4.0/skgsqlcipher/qsql_sqlite.cpp:355:26: error: no matching function for call to 'QSqlCachedResult::QSqlCachedResult(const QSQLiteDriver*&)'
     : QSqlCachedResult(db)
                          ^


Reproducible: Always
Comment 1 demm 2016-06-22 17:52:49 UTC
Since the used driver is quite similar in Skrooge to the one used in Akonadi, perhaps this commit can be used as example:
https://github.com/KDE/akonadi/commit/068c0bd5f93232eea97e492354eff2b9b62c6643

A more detailed error log (build with Clang & Qt 5.7.0)

[ 26%] Building CXX object skgsqlcipher/CMakeFiles/libskgsqlcipher.dir/libskgsqlcipher_automoc.cpp.o
[ 26%] Building CXX object plugins/krunner/skrooge_add_operation/CMakeFiles/skrooge_add_operation.dir/skrooge_add_operation_automoc.cpp.o
[ 27%] Building CXX object skgbasemodeler/CMakeFiles/skgbasemodeler.dir/skgtransactionmng.cpp.o
[ 27%] Building CXX object skgbasemodeler/CMakeFiles/skgbasemodeler.dir/skgservices.cpp.o
[ 27%] Building CXX object skgbasemodeler/CMakeFiles/skgbasemodeler.dir/skgtraces.cpp.o
[ 27%] Building CXX object skgbasemodeler/CMakeFiles/skgbasemodeler.dir/skgerror.cpp.o
[ 27%] Building CXX object skgbasemodeler/CMakeFiles/skgbasemodeler.dir/skgadvice.cpp.o
[ 27%] Linking CXX shared module ../../../lib/skrooge_add_operation.so
[ 28%] Building CXX object skgbasemodeler/CMakeFiles/skgbasemodeler.dir/skgreport.cpp.o
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgtraces.cpp:163:43: error: call to 'qAsConst' is ambiguous
                QString previousMethode = qAsConst(SKGTraces::m_SKGPerfoPathMethode).top();
                                          ^~~~~~~~
/usr/include/qt5/QtCore/qglobal.h:1130:58: note: candidate function [with T = QStack<QString>]
Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
                                                         ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdefine.h:38:47: note: candidate function [with T = QStack<QString>]
Q_DECL_CONSTEXPR typename QAddConst<T>::Type& qAsConst(T& t) Q_DECL_NOTHROW { return t; }
                                              ^
[ 28%] Building CXX object skgbasemodeler/CMakeFiles/skgbasemodeler.dir/skgbasemodeler_automoc.cpp.o
1 error generated.
make[2]: *** [skgbasemodeler/CMakeFiles/skgbasemodeler.dir/build.make:255: skgbasemodeler/CMakeFiles/skgbasemodeler.dir/skgtraces.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 28%] Built target skrooge_add_operation
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgsqlcipher/qsql_sqlite.cpp:355:7: error: no matching constructor for initialization of 'QSqlCachedResult'
    : QSqlCachedResult(db)
      ^                ~~
/usr/include/qt5/QtSql/5.7.0/QtSql/private/qsqlcachedresult_p.h:64:20: note: candidate constructor (the implicit copy constructor) not viable: no known conversion
      from 'const QSQLiteDriver *' to 'const QSqlCachedResult' for 1st argument
class Q_SQL_EXPORT QSqlCachedResult: public QSqlResult
                   ^
/usr/include/qt5/QtSql/5.7.0/QtSql/private/qsqlcachedresult_p.h:72:5: note: candidate constructor not viable: no known conversion from 'const QSQLiteDriver *' to
      'QSqlCachedResultPrivate &' for 1st argument
    QSqlCachedResult(QSqlCachedResultPrivate &d);
    ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdocument.cpp:583:46: error: call to 'qAsConst' is ambiguous
                    for (const auto& table : qAsConst(listModifiedTables)) {
                                             ^~~~~~~~
/usr/include/qt5/QtCore/qglobal.h:1130:58: note: candidate function [with T = QStringList]
Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
                                                         ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdefine.h:38:47: note: candidate function [with T = QStringList]
Q_DECL_CONSTEXPR typename QAddConst<T>::Type& qAsConst(T& t) Q_DECL_NOTHROW { return t; }
                                              ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdocument.cpp:713:30: error: call to 'qAsConst' is ambiguous
        for (const auto& m : qAsConst(m_unTransactionnalMessages)) {
                             ^~~~~~~~
/usr/include/qt5/QtCore/qglobal.h:1130:58: note: candidate function [with T = QVector<SKGDocument::SKGMessage>]
Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
                                                         ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdefine.h:38:47: note: candidate function [with T = QVector<SKGDocument::SKGMessage>]
Q_DECL_CONSTEXPR typename QAddConst<T>::Type& qAsConst(T& t) Q_DECL_NOTHROW { return t; }
                                              ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdocument.cpp:765:30: error: call to 'qAsConst' is ambiguous
        for (const auto& m : qAsConst(m_unTransactionnalMessages)) {
                             ^~~~~~~~
/usr/include/qt5/QtCore/qglobal.h:1130:58: note: candidate function [with T = QVector<SKGDocument::SKGMessage>]
Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
                                                         ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdefine.h:38:47: note: candidate function [with T = QVector<SKGDocument::SKGMessage>]
Q_DECL_CONSTEXPR typename QAddConst<T>::Type& qAsConst(T& t) Q_DECL_NOTHROW { return t; }
                                              ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdocument.cpp:852:30: error: call to 'qAsConst' is ambiguous
        for (const auto& k : qAsConst(keys)) {
                             ^~~~~~~~
/usr/include/qt5/QtCore/qglobal.h:1130:58: note: candidate function [with T = QStringList]
Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
                                                         ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdefine.h:38:47: note: candidate function [with T = QStringList]
Q_DECL_CONSTEXPR typename QAddConst<T>::Type& qAsConst(T& t) Q_DECL_NOTHROW { return t; }
                                              ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdocument.cpp:857:45: error: call to deleted function 'qAsConst'
                    for (const auto& name : qAsConst(m_ImpactedViews.value(item)))
                                            ^~~~~~~~
/usr/include/qt5/QtCore/qglobal.h:1133:6: note: candidate function [with T = QStringList] has been explicitly deleted
void qAsConst(const T &&) Q_DECL_EQ_DELETE;
     ^
/usr/include/qt5/QtCore/qglobal.h:1130:58: note: candidate function [with T = const QStringList]
Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
                                                         ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdefine.h:38:47: note: candidate function [with T = const QStringList]
Q_DECL_CONSTEXPR typename QAddConst<T>::Type& qAsConst(T& t) Q_DECL_NOTHROW { return t; }
                                              ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdocument.cpp:857:45: error: cannot use type 'void' as a range
                    for (const auto& name : qAsConst(m_ImpactedViews.value(item)))
                                            ^
1 error generated.
make[2]: *** [skgsqlcipher/CMakeFiles/libskgsqlcipher.dir/build.make:87: skgsqlcipher/CMakeFiles/libskgsqlcipher.dir/qsql_sqlite.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2726: skgsqlcipher/CMakeFiles/libskgsqlcipher.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgadvice.cpp:94:26: error: call to 'qAsConst' is ambiguous
    for (const auto& c : qAsConst(iCorrections)) {
                         ^~~~~~~~
/usr/include/qt5/QtCore/qglobal.h:1130:58: note: candidate function [with T = const QStringList]
Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
                                                         ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdefine.h:38:47: note: candidate function [with T = const QStringList]
Q_DECL_CONSTEXPR typename QAddConst<T>::Type& qAsConst(T& t) Q_DECL_NOTHROW { return t; }
                                              ^
1 error generated.
make[2]: *** [skgbasemodeler/CMakeFiles/skgbasemodeler.dir/build.make:279: skgbasemodeler/CMakeFiles/skgbasemodeler.dir/skgadvice.cpp.o] Error 1
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdocument.cpp:2530:33: error: call to 'qAsConst' is ambiguous
        for (const auto& line : qAsConst(lines)) {
                                ^~~~~~~~
/usr/include/qt5/QtCore/qglobal.h:1130:58: note: candidate function [with T = QList<QStringList>]
Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
                                                         ^
/buildsys/apps/skrooge/src/skrooge-2.4.0/skgbasemodeler/skgdefine.h:38:47: note: candidate function [with T = QList<QStringList>]
Q_DECL_CONSTEXPR typename QAddConst<T>::Type& qAsConst(T& t) Q_DECL_NOTHROW { return t; }
                                              ^
7 errors generated.
make[2]: *** [skgbasemodeler/CMakeFiles/skgbasemodeler.dir/build.make:159: skgbasemodeler/CMakeFiles/skgbasemodeler.dir/skgdocument.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2814: skgbasemodeler/CMakeFiles/skgbasemodeler.dir/all] Error 2
make: *** [Makefile:139: all] Error 2
==> ERROR: A failure occurred in build().
Comment 2 Joe 2016-06-29 03:01:39 UTC
I am also getting this error attempting to compile against the latest release + QT 5.7.
Comment 3 Piotr Wicijowski 2016-06-30 12:01:43 UTC
I also get this errors.

Skrooge Version: both 2.4.0 and current git master 7516ce2
OS: Arch linux x86_64
Comment 4 Olivier Pena 2016-07-03 18:23:54 UTC
Created attachment 99835 [details]
fix build with Qt 5.7

Based on comment above about akonadi, I fixed the problem with the attached modification.
Comment 5 demm 2016-07-03 18:51:53 UTC
Thanks for the patch, fixed the build here too.  Builds & runs fine on Qt 5.7.0.
Comment 6 Piotr Wicijowski 2016-07-03 19:22:39 UTC
I confirm that the patch fixes the build for me as well. Seems to run fine as well.
Comment 7 Stephane MANKOWSKI 2016-07-04 21:57:29 UTC
Git commit 0d3d76b7c2aeab2e1819735e1ddcb03f028b5f27 by Stephane Mankowski.
Committed on 04/07/2016 at 21:57.
Pushed by smankowski into branch 'master'.
Doesn't build with Qt 5.7
Corrected by this commit: https://quickgit.kde.org/?p=skrooge.git&a=commit&h=8990deb49b332f75b3b7a26c2eeb8c00e9bb2f09

M  +1    -0    CHANGELOG

http://commits.kde.org/skrooge/0d3d76b7c2aeab2e1819735e1ddcb03f028b5f27