Openage: Qt MOC build error because of compact namespace definitions

Created on 16 Aug 2018  Β·  7Comments  Β·  Source: SFTtech/openage

$make
[...]
[ 12%] Building CXX object nyan-external/bin/nyan/CMakeFiles/nyan.dir/value/value.cpp.o
[ 12%] Building CXX object nyan-external/bin/nyan/CMakeFiles/nyan.dir/value/value_holder.cpp.o
[ 12%] Building CXX object nyan-external/bin/nyan/CMakeFiles/nyan.dir/view.cpp.o
[ 13%] Linking CXX shared library libnyan.so
Scanning dependencies of target cythonize
[ 14%] pxdgen: generating .pxd files from headers
[ 14%] cythonize.py: compiling .pyx files to .cpp
Scanning dependencies of target codegen
[ 14%] openage.codegen: generating c++ code
Scanning dependencies of target libopenage_autogen
[ 14%] Automatic MOC for target libopenage

AutoMoc subprocess error
------------------------
moc failed for
  "/home/felix/Desktop/openage/openage/libopenage/engine.h"

Command
-------
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -I/home/felix/Desktop/openage/openage/.bin/clang++-release-Oauto-sanitize-none/libopenage/libopenage_autogen/include -I/usr/include/freetype2 -I/usr/include/x86_64-linux-gnu/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/home/felix/Desktop/openage/openage/.bin/clang++-release-Oauto-sanitize-none/nyan-external/source/nyan/.. -I/usr/include/eigen3 -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I/usr/include/x86_64-linux-gnu/qt5/QtQuick -I/usr/include/x86_64-linux-gnu/qt5/QtQml -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -o /home/felix/Desktop/openage/openage/.bin/clang++-release-Oauto-sanitize-none/libopenage/libopenage_autogen/EWIEGA46WW/moc_engine.cpp /home/felix/Desktop/openage/openage/libopenage/engine.h

Output
------
home/felix/Desktop/openage/openage/libopenage/util/constexpr.:12: Parse error at "openage"

libopenage/CMakeFiles/libopenage_autogen.dir/build.make:77: die Regel fΓΌr Ziel β€žlibopenage/CMakeFiles/libopenage_autogenβ€œ scheiterte
make[3]: *** [libopenage/CMakeFiles/libopenage_autogen] Fehler 1
CMakeFiles/Makefile2:1567: die Regel fΓΌr Ziel β€žlibopenage/CMakeFiles/libopenage_autogen.dir/allβ€œ scheiterte
make[2]: *** [libopenage/CMakeFiles/libopenage_autogen.dir/all] Fehler 2
Makefile:162: die Regel fΓΌr Ziel β€žallβ€œ scheiterte
make[1]: *** [all] Fehler 2
Makefile:33: die Regel fΓΌr Ziel β€žbuildβ€œ scheiterte
make: *** [build] Fehler 2

previous:

$./configure --download-nyan --mode=release --compiler=clang --prefix=/usr/local
 _________________________________________
/ ./configure is a convenience script: it \
| creates the build directory, symlinks   |
| it, and invokes cmake for an            |
| out-of-source build.                    |
|                                         |
| Nobody is stopping you from skipping    |
| ./configure and our Makefile, and using |
| CMake directly (e.g. when packaging, or |
| using an IDE). For your convenience,    |
| ./configure even prints the direct      |
\ CMake invocation!                       /
 -----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

         build_type | Release
       cxx_compiler | clang++
          cxx_flags | 
   exe_linker_flags | 
     install_prefix | /usr/local
module_linker_flags | 
shared_linker_flags | 

config options:

          backtrace | if_available
gperftools-profiler | if_available
gperftools-tcmalloc | False
            inotify | if_available
            ncurses | if_available
             opengl | if_available
             vulkan | if_available

bindir:
/home/felix/Desktop/openage/openage/.bin/clang++-release-Oauto-sanitize-none/

invocation:
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS='' -DCMAKE_EXE_LINKER_FLAGS='' -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_MODULE_LINKER_FLAGS='' -DCMAKE_SHARED_LINKER_FLAGS='' -DDOWNLOAD_NYAN=YES -DCXX_OPTIMIZATION_LEVEL=auto -DCXX_SANITIZE_FATAL=False -DCXX_SANITIZE_MODE=none -DWANT_BACKTRACE=if_available -DWANT_GPERFTOOLS_PROFILER=if_available -DWANT_GPERFTOOLS_TCMALLOC=False -DWANT_INOTIFY=if_available -DWANT_NCURSES=if_available -DWANT_OPENGL=if_available -DWANT_VULKAN=if_available -- /home/felix/Desktop/openage/openage

(now running cmake:)



 ___  ______ _______ _______ ___
|  _)/ _____|_______|_______|_  |
| | ( (____  _____      _     | |    ___  ____  _____ ____  _____  ____ _____
| |  \____ \|  ___)    | |    | |   / _ \|  _ \| ___ |  _ \(____ |/ _  | ___ |
| |_ _____) ) |        | |   _| |  | |_| | |_| | ____| | | / ___ ( (_| | ____|
|___|______/|_|        |_|  (___|   \___/|  __/|_____)_| |_\_____|\___ |_____)
                                         |_|                     (_____|

Welcome to the SFT technologies computer-aided openage build system!

You have chosen, or been chosen, to attempt the daring task of building openage.
If you have installed all the dependencies that are conveniently listed in
[doc/building.md], this _might_ just work!

If it doesn't, consider reporting the issue: https://github.com/SFTtech/openage
Or ask for help:
  * Matrix: #sfttech:matrix.org
  * IRC:    #sfttech on freenode.net

-- Using python interpreter: /usr/bin/python3
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
CMake Warning at buildsystem/doxygen.cmake:50 (message):
  doxygen couldn't be found, you won't be able to generate docs
Call Stack (most recent call first):
  CMakeLists.txt:190 (doxygen_configure)


You have called ADD_LIBRARY for library libopenage without any source files. This typically indicates a problem with your CMakeLists.txt file
-- Could NOT find GCCBacktrace (missing: GCCBacktrace_LIBRARIES GCCBacktrace_INCLUDE_DIRS) 
-- Could NOT find nyan (missing: nyan_DIR)
-- Downloading nyan as submodule project...


       β–„β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–„
      β–ˆβ–‘β–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–‘β–‘β–‘β–ˆ
      β–ˆβ–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–„β–€β–€β–„β–’β–’β–’β–‘β–‘β–ˆβ–„β–€β–€β–„
 β–„β–„   β–ˆβ–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–“β–“β–“β–€β–„β–„β–„β–„β–€β–“β–“β–“β–ˆ      β–„ β–„β–„   β–„   β–„   β–„β–„β–„   β–„ β–„β–„
β–ˆβ–“β–“β–ˆβ–„β–„β–ˆβ–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–„β–€β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–€β–„     β–ˆβ–€  β–ˆ  β–€β–„ β–„β–€  β–€   β–ˆ  β–ˆβ–€  β–ˆ
 β–€β–„β–„β–“β–“β–ˆβ–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–“β–“β–“β–„β–ˆβ–“β–“β–“β–„β–“β–„β–ˆβ–“β–“β–ˆ     β–ˆ   β–ˆ   β–ˆβ–„β–ˆ   β–„β–€β–€β–€β–ˆ  β–ˆ   β–ˆ
    β–€β–€β–ˆβ–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–“β–’β–’β–“β–„β–“β–“β–„β–“β–“β–„β–“β–’β–’β–ˆ     β–ˆ   β–ˆ   β–€β–ˆ    β–€β–„β–„β–€β–ˆ  β–ˆ   β–ˆ
     β–„β–ˆβ–‘β–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–€β–„β–“β–“β–€β–€β–€β–€β–€β–€β–€β–“β–„β–€              β–„β–€
   β–„β–€β–“β–€β–ˆβ–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–ˆβ–€β–€               β–€β–€
   β–ˆβ–„β–„β–€ β–ˆβ–„β–„β–€       β–ˆβ–„β–„β–€ β–€β–„β–„β–ˆ


For information about building, look at [doc/building.md].

If you encounter problems you can't fix yourself,
report problems at https://github.com/SFTtech/nyan

Contact: #sfttech:matrix.org

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 

          project | nyan
          version | 1.0
         compiler | Clang 6.0.1
       build type | Release
         cxxflags |  -Wall -Wextra -pedantic
 build type flags | -O3
        build dir | /home/felix/Desktop/openage/openage/.bin/clang++-release-Oauto-sanitize-none
   install prefix | /usr/local

-- nyan processed successfully!
-- optional dependency is unavailable: backtrace
-- Could NOT find Gperftools (missing: GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR) 
-- optional dependency is unavailable: gperftools-profiler
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH) 
-- optional dependency is unavailable: ncurses
-- Could NOT find Vulkan (missing: Vulkan_LIBRARY Vulkan_INCLUDE_DIR) 
-- optional dependency is unavailable: vulkan

cython module
    run                                                 [embedded interpreter] [noinstall]
    openage.cabextract.lzxd
    openage.cabextract.cabchecksum                      [standalone]
    openage.convert.slp
    openage.convert.interface.visgrep
    openage.convert.opus.opusenc
    openage.cppinterface.exctranslate
    openage.cppinterface.exctranslate_tests
    openage.cppinterface.pyobject
    openage.cppinterface.setup_checker
    openage.cvar.cvar
    openage.event.demo
    openage.game.main_cpp
    openage.log.log_cpp
    openage.util.filelike.cpp
    openage.util.fslike.cpp
    openage.renderer.renderer_cpp
    openage.renderer.tests
    openage.testing.cpp_testing
    openage.testing.misc_cpp

enabled options:
    inotify
    opengl

disabled options:
    backtrace
    gperftools-profiler
    gperftools-tcmalloc
    ncurses
    vulkan

openage v0.3.0-1312-g69223d8

         compiler | Clang 6.0.1
       build type | Release
         cxxflags |   -Wall -Wextra -pedantic -Wno-gnu-statement-expression
 build type flags | -DNDEBUG -O3
        build dir | /home/felix/Desktop/openage/openage/.bin/clang++-release-Oauto-sanitize-none
   install prefix | /usr/local
py install prefix | /usr/lib/python3/dist-packages

-- Configuring done
-- Generating done
-- Build files have been written to: /home/felix/Desktop/openage/openage/.bin/clang++-release-Oauto-sanitize-none
bug buildsystem

All 7 comments

Hmm, /util/constexpr.:12: Parse error at "openage" looks suspicious.

Any idea where that comes from? Does the moc command (with all its args) fail reliably, when you execute it manually?

Yes, the moc command fails all the time:

/usr/lib/x86_64-linux-gnu/qt5/bin/moc -I/home/felix/Desktop/openage/openage/.bin/clang++-release-Oauto-sanitize-none/libopenage/libopenage_autogen/include -I/usr/include/freetype2 -I/usr/include/x86_64-linux-gnu/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/home/felix/Desktop/openage/openage/.bin/clang++-release-Oauto-sanitize-none/nyan-external/source/nyan/.. -I/usr/include/eigen3 -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I/usr/include/x86_64-linux-gnu/qt5/QtQuick -I/usr/include/x86_64-linux-gnu/qt5/QtQml -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -o /home/felix/Desktop/openage/openage/.bin/clang++-release-Oauto-sanitize-none/libopenage/libopenage_autogen/EWIEGA46WW/moc_engine.cpp /home/felix/Desktop/openage/openage/libopenage/engine.h
home/felix/Desktop/openage/openage/libopenage/util/constexpr.:12: Parse error at "openage"

Using g++ (Ubuntu 7.3.0-21ubuntu1~16.04) 7.3.0 gives the same error...

The moc is a tool from Qt that creates c++ files from existing c++-files with qt-annotations. What Qt version do you have?

I suspect that there is a problem with your moc installation (i.e. Qt), because there hasn't been a bug report about that and many ubuntu users had success installing openage.
Do you have any PPAs active?

Was there any progress on this issue. Because I tried this with a fresh installation of ubuntu 16.04 and get the same error. Previously however, I have managed to get it to work without facing this error on ubuntu 16.04

Update
This issue is caused by the compact namespace definitions of the form namespace a::b::c in the files openage/libopenage/util/constexpr.h and openage/libopenage/util/misc.h. This error can be removed using cascading namespaces or by upgrading Qt version to Qt 5.8 where it seems to be solved.

Can you submit a pull request please, with this version bump of Qt and also updated build requirement documents?

We'll bump the version in #1064.

Was this page helpful?
0 / 5 - 0 ratings