Kdev-clang master not building

Lucas Tanure tanure at linux.com
Sat Apr 25 16:30:58 UTC 2015


On Sat, Apr 25, 2015 at 9:46 AM, Lucas Tanure <tanure at linux.com> wrote:
> Kdev-clang master is currently not building:
>
> [  1%] Automatic moc for target kdevclangutil
> [  1%] Built target kdevclangutil_automoc
> [  7%] Built target kdevclangutil
> [  8%] Automatic moc for target kdevclangsupport
> [  8%] Built target kdevclangsupport_automoc
> [  9%] Automatic moc for target kdevclangcodecompletion
> [  9%] Built target kdevclangcodecompletion_automoc
> [ 11%] Automatic moc for target kdevclangcodegen
> [ 11%] Built target kdevclangcodegen_automoc
> [ 12%] Automatic moc for target kdevclangduchain
> [ 12%] Built target kdevclangduchain_automoc
> [ 21%] Built target kdevclangcodegen
> [ 22%] Building CXX object
> codecompletion/CMakeFiles/kdevclangcodecompletion.dir/model.cpp.o
> In file included from /usr/include/qt/QtCore/qpair.h:37:0,
>                  from /usr/include/qt/QtCore/QPair:1,
>                  from
> /opt/kdevelop/include/kdevplatform/language/codecompletion/codecompletionmodel.h:26,
>                  from
> /home/tanure/workspace/src/kdev-clang/codecompletion/model.h:25,
>                  from
> /home/tanure/workspace/src/kdev-clang/codecompletion/model.cpp:22:
> /usr/include/qt/QtCore/qmetatype.h: In instantiation of ‘constexpr int
> qMetaTypeId() [with T = KTextEditor::Cursor]’:
> /usr/include/qt/QtCore/qmetatype.h:1655:27:   required from ‘constexpr
> int qRegisterMetaType() [with T = KTextEditor::Cursor]’
> /home/tanure/workspace/src/kdev-clang/codecompletion/model.cpp:152:44:
>   required from here
> /usr/include/qt/QtCore/qmetatype.h:1648:5: error: static assertion
> failed: Type is not registered, please use the Q_DECLARE_METATYPE
> macro to make it known to Qt's meta-object system
>      Q_STATIC_ASSERT_X(QMetaTypeId2<T>::Defined, "Type is not
> registered, please use the Q_DECLARE_METATYPE macro to make it known
> to Qt's meta-object system");
>      ^
> In file included from /usr/include/qt/QtCore/qobject.h:48:0,
>                  from /usr/include/qt/QtCore/qsharedpointer_impl.h:57,
>                  from /usr/include/qt/QtCore/qsharedpointer.h:42,
>                  from /usr/include/qt/QtCore/qpointer.h:37,
>                  from /usr/include/qt/QtCore/QPointer:1,
>                  from
> /opt/kdevelop/include/kdevplatform/language/codecompletion/codecompletionmodel.h:28,
>                  from
> /home/tanure/workspace/src/kdev-clang/codecompletion/model.h:25,
>                  from
> /home/tanure/workspace/src/kdev-clang/codecompletion/model.cpp:22:
> /usr/include/qt/QtCore/qmetatype.h: In instantiation of ‘static
> constexpr int QMetaTypeId2<T>::qt_metatype_id() [with T =
> KTextEditor::Cursor]’:
> /usr/include/qt/QtCore/qmetatype.h:1649:44:   required from ‘constexpr
> int qMetaTypeId() [with T = KTextEditor::Cursor]’
> /usr/include/qt/QtCore/qmetatype.h:1655:27:   required from ‘constexpr
> int qRegisterMetaType() [with T = KTextEditor::Cursor]’
> /home/tanure/workspace/src/kdev-clang/codecompletion/model.cpp:152:44:
>   required from here
> /usr/include/qt/QtCore/qmetatype.h:1509:97: error: ‘qt_metatype_id’ is
> not a member of ‘QMetaTypeId<KTextEditor::Cursor>’
>      static inline Q_DECL_CONSTEXPR int qt_metatype_id() { return
> QMetaTypeId<T>::qt_metatype_id(); }
>
>                           ^
> /usr/include/qt/QtCore/qmetatype.h:1509:100: error: body of constexpr
> function ‘static constexpr int QMetaTypeId2<T>::qt_metatype_id() [with
> T = KTextEditor::Cursor]’ not a return-statement
>      static inline Q_DECL_CONSTEXPR int qt_metatype_id() { return
> QMetaTypeId<T>::qt_metatype_id(); }
>
>                              ^
> codecompletion/CMakeFiles/kdevclangcodecompletion.dir/build.make:54:
> recipe for target
> 'codecompletion/CMakeFiles/kdevclangcodecompletion.dir/model.cpp.o'
> failed
> make[2]: *** [codecompletion/CMakeFiles/kdevclangcodecompletion.dir/model.cpp.o]
> Error 1
> CMakeFiles/Makefile2:257: recipe for target
> 'codecompletion/CMakeFiles/kdevclangcodecompletion.dir/all' failed
> make[1]: *** [codecompletion/CMakeFiles/kdevclangcodecompletion.dir/all] Error 2
> Makefile:126: recipe for target 'all' failed
> make: *** [all] Error 2
>
> Thanks
> --
> Lucas Tanure
> +55 (19) 988176559

I have one fix for kdev-clang in order to compile.

diff --git a/codecompletion/model.cpp b/codecompletion/model.cpp
index 0dcf44c..34d1af1 100644
--- a/codecompletion/model.cpp
+++ b/codecompletion/model.cpp
@@ -39,6 +39,8 @@

 using namespace KDevelop;

+Q_DECLARE_METATYPE(KTextEditor::Cursor)
+
 namespace {

 bool includePathCompletionRequired(const QString& text)
diff --git a/tests/test_clangutils.cpp b/tests/test_clangutils.cpp
index fb33f76..71f9d04 100644
--- a/tests/test_clangutils.cpp
+++ b/tests/test_clangutils.cpp
@@ -39,6 +39,7 @@
 #include <memory>

 QTEST_MAIN(TestClangUtils)
+Q_DECLARE_METATYPE(KTextEditor::Range)

 using namespace KDevelop;

diff --git a/tests/test_duchainutils.cpp b/tests/test_duchainutils.cpp
index 7393587..99fa017 100644
--- a/tests/test_duchainutils.cpp
+++ b/tests/test_duchainutils.cpp
@@ -31,6 +31,7 @@
 #include <QtTest>

 using namespace KDevelop;
+Q_DECLARE_METATYPE(KTextEditor::Range)

 QTEST_GUILESS_MAIN(TestDUChainUtils);
--
Lucas Tanure
+55 (19) 988176559


More information about the KDevelop-devel mailing list