Cannot build Qt Creator 4.4.0 from source
-
I tried to build Qt creator 4.4.0 from source with Qt 5.9.0 and it still has following compiling error. In fact it happen back in 4.3.0 too, so I still use 4.2.1 for my work. Since 4.4.0 is out I decide to give it a try.
Enviroment
Linux: CentOS 7
GCC: 5.1.0
Qt: 5.9.0
Qt Creator: 4.4.0g++ -c -pipe -O2 -std=gnu++1y -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -D'RELATIVE_PLUGIN_PATH="../lib/qtcreator/plugins"' -D'RELATIVE_LIBEXEC_PATH="../libexec/qtcreator"' -D'RELATIVE_DATA_PATH="../share/qtcreator"' -D'RELATIVE_DOC_PATH="../share/doc/qtcreator"' -DIDE_LIBRARY_BASENAME=\"lib\" -DQT_CREATOR -DQT_NO_CAST_TO_ASCII -DQT_RESTRICTED_CAST_FROM_ASCII -DQT_DISABLE_DEPRECATED_BEFORE=0x050600 -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DUTILS_LIBRARY -DQTC_REL_TOOLS_PATH='"../libexec/qtcreator"' -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../../src -I../../../src -I../../libs -I/autohome/local/Software/qt/source/qt-creator-opensource-src-4.4.0/tools -I../../plugins -I/autohome/local/Software/qt/qt-5.9.1/include -I/autohome/local/Software/qt/qt-5.9.1/include/QtWidgets -I/autohome/local/Software/qt/qt-5.9.1/include/QtGui -I/autohome/local/Software/qt/qt-5.9.1/include/QtConcurrent -I/autohome/local/Software/qt/qt-5.9.1/include/QtQml -I/autohome/local/Software/qt/qt-5.9.1/include/QtNetwork -I/autohome/local/Software/qt/qt-5.9.1/include/QtCore -I.moc/release-shared -isystem /usr/include/libdrm -I.uic -I/autohome/local/Software/qt/qt-5.9.1/mkspecs/linux-g++ -o .obj/release-shared/theme.o theme/theme.cpp In file included from /usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algobase.h:71:0, from /usr/local/gcc-5.1.0/include/c++/5.1.0/algorithm:61, from /autohome/local/Software/qt/qt-5.9.1/include/QtCore/qglobal.h:109, from utils_global.h:28, from treemodel.h:28, from treemodel.cpp:26: /usr/local/gcc-5.1.0/include/c++/5.1.0/bits/predefined_ops.h: In instantiation of \u2018constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = const Utils::TreeItem*; _Iterator2 = const Utils::TreeItem*; _Compare = std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)>]\u2019: /usr/local/gcc-5.1.0/include/c++/5.1.0/functional:1982:6: required by substitution of \u2018template<class _Res, class ... _ArgTypes> template<class _Functor> using _Invoke = decltype (std::__callable_functor(declval<_Functor&>())((declval<_ArgTypes>)()...)) [with _Functor = __gnu_cxx::__ops::_Iter_comp_iter<std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)> >; _Res = bool; _ArgTypes = {const Utils::TreeItem*, const Utils::TreeItem*}]\u2019 /usr/local/gcc-5.1.0/include/c++/5.1.0/functional:1992:56: required by substitution of \u2018template<class _Res, class ... _ArgTypes> template<class _Functor> using _Callable = std::__and_<std::function<_Res(_ArgTypes ...)>::_NotSelf<_Functor>, std::__check_func_return_type<std::function<_Res(_ArgTypes ...)>::_Invoke<_Functor>, _Res> > [with _Functor = __gnu_cxx::__ops::_Iter_comp_iter<std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)> >; _Res = bool; _ArgTypes = {const Utils::TreeItem*, const Utils::TreeItem*}]\u2019 /usr/local/gcc-5.1.0/include/c++/5.1.0/functional:2057:9: required by substitution of \u2018template<class _Functor, class> std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = __gnu_cxx::__ops::_Iter_comp_iter<std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)> >; <template-parameter-1-2> = <missing>]\u2019 /usr/local/gcc-5.1.0/include/c++/5.1.0/bits/predefined_ops.h:130:46: required from \u2018constexpr __gnu_cxx::__ops::_Iter_comp_iter<_Compare> __gnu_cxx::__ops::__iter_comp_iter(_Compare) [with _Compare = std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)>]\u2019 /usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algo.h:4729:70: required from \u2018void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = Utils::TreeItem**; _Compare = std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)>]\u2019 treemodel.cpp:732:50: required from here /usr/local/gcc-5.1.0/include/c++/5.1.0/bits/predefined_ops.h:123:46: error: no match for call to \u2018(std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)>) (const Utils::TreeItem&, const Utils::TreeItem&)\u2019 { return bool(_M_comp(*__it1, *__it2)); } ^ In file included from /autohome/local/Software/qt/qt-5.9.1/include/QtCore/qmap.h:54:0, from /autohome/local/Software/qt/qt-5.9.1/include/QtCore/qvariant.h:47, from /autohome/local/Software/qt/qt-5.9.1/include/QtCore/qabstractitemmodel.h:43, from /autohome/local/Software/qt/qt-5.9.1/include/QtCore/QAbstractItemModel:1, from treemodel.h:30, from treemodel.cpp:26: /usr/local/gcc-5.1.0/include/c++/5.1.0/functional:2266:5: note: candidate: _Res std::function<_Res(_ArgTypes ...)>::operator()(_ArgTypes ...) const [with _Res = bool; _ArgTypes = {const Utils::TreeItem*, const Utils::TreeItem*}] function<_Res(_ArgTypes...)>:: ^ /usr/local/gcc-5.1.0/include/c++/5.1.0/functional:2266:5: note: no known conversion for argument 1 from \u2018const Utils::TreeItem\u2019 to \u2018const Utils::TreeItem*\u2019 g++ -c -pipe -O2 -std=gnu++1y -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -D'RELATIVE_PLUGIN_PATH="../lib/qtcreator/plugins"' -D'RELATIVE_LIBEXEC_PATH="../libexec/qtcreator"' -D'RELATIVE_DATA_PATH="../share/qtcreator"' -D'RELATIVE_DOC_PATH="../share/doc/qtcreator"' -DIDE_LIBRARY_BASENAME=\"lib\" -DQT_CREATOR -DQT_NO_CAST_TO_ASCII -DQT_RESTRICTED_CAST_FROM_ASCII -DQT_DISABLE_DEPRECATED_BEFORE=0x050600 -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DUTILS_LIBRARY -DQTC_REL_TOOLS_PATH='"../libexec/qtcreator"' -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../../src -I../../../src -I../../libs -I/autohome/local/Software/qt/source/qt-creator-opensource-src-4.4.0/tools -I../../plugins -I/autohome/local/Software/qt/qt-5.9.1/include -I/autohome/local/Software/qt/qt-5.9.1/include/QtWidgets -I/autohome/local/Software/qt/qt-5.9.1/include/QtGui -I/autohome/local/Software/qt/qt-5.9.1/include/QtConcurrent -I/autohome/local/Software/qt/qt-5.9.1/include/QtQml -I/autohome/local/Software/qt/qt-5.9.1/include/QtNetwork -I/autohome/local/Software/qt/qt-5.9.1/include/QtCore -I.moc/release-shared -isystem /usr/include/libdrm -I.uic -I/autohome/local/Software/qt/qt-5.9.1/mkspecs/linux-g++ -o .obj/release-shared/progressindicator.o progressindicator.cpp make[3]: *** [.obj/release-shared/treemodel.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory `/autohome/local/Software/qt/source/qt-creator-opensource-src-4.4.0/src/libs/utils' make[2]: *** [sub-utils-make_first] Error 2 make[2]: *** Waiting for unfinished jobs....
I have noticed that in message it used "-std=gnu++1y" in compiler flag, does qt creator now requires c++17? Is that listed in any document? It is so frustrated...
-
@blazar0112 I'm quite sure it does not require C++17.
How did you call configure? -
@jsulm What you do mean "configure"? Configure when installing Qt or Qt creator?
For Qt creator I follow the instruction in README .md which is just
qmake -r make -j8
For version before Qt creator 4.2.1 this flow works properly for me. (I've been from 3.1 to 4.2.1)
The configure for Qt I used I believe it was
./configure -prefix /autohome/local/Software/qt/qt-5.9.1 -nomake tests -qt-xcb -skip webengine
Edit: remove link and correct version to Qt 5.9.1. How to avoid to link when typing README + .md?
-
@blazar0112 Could you please try
make
instead ofmake -j8
? -
@name_qt same result
/usr/local/gcc-5.1.0/include/c++/5.1.0/bits/predefined_ops.h: In instantiation of \u2018constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = const Utils::TreeItem*; _Iterator2 = const Utils::TreeItem*; _Compare = std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)>]\u2019: /usr/local/gcc-5.1.0/include/c++/5.1.0/functional:1982:6: required by substitution of \u2018template<class _Res, class ... _ArgTypes> template<class _Functor> using _Invoke = decltype (std::__callable_functor(declval<_Functor&>())((declval<_ArgTypes>)()...)) [with _Functor = __gnu_cxx::__ops::_Iter_comp_iter<std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)> >; _Res = bool; _ArgTypes = {const Utils::TreeItem*, const Utils::TreeItem*}]\u2019 /usr/local/gcc-5.1.0/include/c++/5.1.0/functional:1992:56: required by substitution of \u2018template<class _Res, class ... _ArgTypes> template<class _Functor> using _Callable = std::__and_<std::function<_Res(_ArgTypes ...)>::_NotSelf<_Functor>, std::__check_func_return_type<std::function<_Res(_ArgTypes ...)>::_Invoke<_Functor>, _Res> > [with _Functor = __gnu_cxx::__ops::_Iter_comp_iter<std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)> >; _Res = bool; _ArgTypes = {const Utils::TreeItem*, const Utils::TreeItem*}]\u2019 /usr/local/gcc-5.1.0/include/c++/5.1.0/functional:2057:9: required by substitution of \u2018template<class _Functor, class> std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = __gnu_cxx::__ops::_Iter_comp_iter<std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)> >; <template-parameter-1-2> = <missing>]\u2019 /usr/local/gcc-5.1.0/include/c++/5.1.0/bits/predefined_ops.h:130:46: required from \u2018constexpr __gnu_cxx::__ops::_Iter_comp_iter<_Compare> __gnu_cxx::__ops::__iter_comp_iter(_Compare) [with _Compare = std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)>]\u2019 /usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algo.h:4729:70: required from \u2018void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = Utils::TreeItem**; _Compare = std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)>]\u2019 treemodel.cpp:732:50: required from here /usr/local/gcc-5.1.0/include/c++/5.1.0/bits/predefined_ops.h:123:46: error: no match for call to \u2018(std::function<bool(const Utils::TreeItem*, const Utils::TreeItem*)>) (const Utils::TreeItem&, const Utils::TreeItem&)\u2019 { return bool(_M_comp(*__it1, *__it2)); } ^ In file included from /autohome/local/Software/qt/qt-5.9.1/include/QtCore/qmap.h:54:0, from /autohome/local/Software/qt/qt-5.9.1/include/QtCore/qvariant.h:47, from /autohome/local/Software/qt/qt-5.9.1/include/QtCore/qabstractitemmodel.h:43, from /autohome/local/Software/qt/qt-5.9.1/include/QtCore/QAbstractItemModel:1, from treemodel.h:30, from treemodel.cpp:26: /usr/local/gcc-5.1.0/include/c++/5.1.0/functional:2266:5: note: candidate: _Res std::function<_Res(_ArgTypes ...)>::operator()(_ArgTypes ...) const [with _Res = bool; _ArgTypes = {const Utils::TreeItem*, const Utils::TreeItem*}] function<_Res(_ArgTypes...)>:: ^ /usr/local/gcc-5.1.0/include/c++/5.1.0/functional:2266:5: note: no known conversion for argument 1 from \u2018const Utils::TreeItem\u2019 to \u2018const Utils::TreeItem*\u2019 make[3]: *** [.obj/release-shared/treemodel.o] Error 1 make[3]: Leaving directory `/autohome/local/Software/qt/source/qt-creator-opensource-src-4.4.0/src/libs/utils' make[2]: *** [sub-utils-make_first] Error 2 make[2]: Leaving directory `/autohome/local/Software/qt/source/qt-creator-opensource-src-4.4.0/src/libs' make[1]: *** [sub-libs-make_first-ordered] Error 2 make[1]: Leaving directory `/autohome/local/Software/qt/source/qt-creator-opensource-src-4.4.0/src' make: *** [sub-src-make_first-ordered] Error 2 % history 8 1026 17:22 ls 1027 17:22 vim README.md 1028 17:22 qmake -r 1029 17:23 make
Guess my company bought Qt commercial license too early, this kind of thing always happen after license end, sigh.
-
I've tried some combination of compiler versions and found following result:
- Using GCC 5.1.0 compile qt source up to 5.10.0 ... OK.
- Using GCC 5.1.0 compile qt-creator source from 4.3.0 to 4.5.0 ... all failed at same error from treemodel.cpp complain something in predefined_ops.h
- Using GCC 7.2.0 compile qt-creator source 4.5.0 ... It's OK.
So at least I found some way to build newer qt-creator source...