• 0
bogme

Compiling Noggit Qt on Linux

Question

So I've been trying to compile noggit on Linux, but I think I'm doing something wrong.

I've been following the Readme for the terrain_shader branch and, until I run make, everything seems to work (CMake finds the required librariesevery required library and generates the project files correctly). After running make I get the following error: (There are a few of them, but they seem to be the same message)

/home/user/wow/tools/noggit3/src/external/qt-color-widgets/src/abstract_widget_list.cpp:29:27: error: 
      'QSignalMapper' is deprecated [-Werror,-Wdeprecated-declarations]
class AbstractWidgetList::Private
                          ^

Complete log:

$ make -j8
Scanning dependencies of target noggit-math
[  1%] Building CXX object CMakeFiles/noggit-math.dir/src/math/vector_2d.cpp.o
[  1%] Building CXX object CMakeFiles/noggit-math.dir/src/math/matrix_4x4.cpp.o
[  2%] Building CXX object src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/color_2d_slider.cpp.o
[  2%] Building CXX object src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/bound_color_selector.cpp.o
[  2%] Building CXX object src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/color_delegate.cpp.o
[  4%] Building CXX object src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/abstract_widget_list.cpp.o
[  4%] Building CXX object src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/color_line_edit.cpp.o
[  5%] Building CXX object src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/color_dialog.cpp.o
[  5%] Building CXX object src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/color_list_widget.cpp.o
[  6%] Linking CXX static library libnoggit-math.a
[  6%] Built target noggit-math
Scanning dependencies of target math-matrix_4x4.test
[  6%] Building CXX object CMakeFiles/math-matrix_4x4.test.dir/test/math/matrix_4x4.cpp.o
[  7%] Building CXX object src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/color_names.cpp.o
/home/user/wow/tools/noggit3/src/external/qt-color-widgets/src/abstract_widget_list.cpp:29:27: error: 
      'QSignalMapper' is deprecated [-Werror,-Wdeprecated-declarations]
class AbstractWidgetList::Private
                          ^
/home/user/wow/tools/noggit3/src/external/qt-color-widgets/src/abstract_widget_list.cpp:40:28: note: 
      in implicit default constructor for 'AbstractWidgetList::Private' first required here
    QWidget(parent), p(new Private)
                           ^
/usr/include/qt5/QtCore/qsignalmapper.h:56:5: note: 'QSignalMapper' has been explicitly marked
      deprecated here
    QT_DEPRECATED explicit QSignalMapper(QObject *parent = nullptr);
    ^
/usr/include/qt5/QtCore/qglobal.h:292:25: note: expanded from macro 'QT_DEPRECATED'
#  define QT_DEPRECATED Q_DECL_DEPRECATED
                        ^
/usr/include/qt5/QtCore/qcompilerdetection.h:233:45: note: expanded from macro 'Q_DECL_DEPRECATED'
#  define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
                                            ^
/home/user/wow/tools/noggit3/src/external/qt-color-widgets/src/abstract_widget_list.cpp:29:27: error: 
      'QSignalMapper' is deprecated [-Werror,-Wdeprecated-declarations]
class AbstractWidgetList::Private
                          ^
/usr/include/qt5/QtCore/qsignalmapper.h:56:5: note: 'QSignalMapper' has been explicitly marked
      deprecated here
    QT_DEPRECATED explicit QSignalMapper(QObject *parent = nullptr);
    ^
/usr/include/qt5/QtCore/qglobal.h:292:25: note: expanded from macro 'QT_DEPRECATED'
#  define QT_DEPRECATED Q_DECL_DEPRECATED
                        ^
/usr/include/qt5/QtCore/qcompilerdetection.h:233:45: note: expanded from macro 'Q_DECL_DEPRECATED'
#  define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
                                            ^
/home/user/wow/tools/noggit3/src/external/qt-color-widgets/src/abstract_widget_list.cpp:29:27: error: 
      'QSignalMapper' is deprecated [-Werror,-Wdeprecated-declarations]
class AbstractWidgetList::Private
                          ^
/usr/include/qt5/QtCore/qsignalmapper.h:56:5: note: 'QSignalMapper' has been explicitly marked
      deprecated here
    QT_DEPRECATED explicit QSignalMapper(QObject *parent = nullptr);
    ^
/usr/include/qt5/QtCore/qglobal.h:292:25: note: expanded from macro 'QT_DEPRECATED'
#  define QT_DEPRECATED Q_DECL_DEPRECATED
                        ^
/usr/include/qt5/QtCore/qcompilerdetection.h:233:45: note: expanded from macro 'Q_DECL_DEPRECATED'
#  define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
                                            ^
3 errors generated.
make[2]: *** [src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/build.make:141: src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/abstract_widget_list.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Scanning dependencies of target math-trig.test
[  8%] Building CXX object CMakeFiles/math-trig.test.dir/test/math/trig.cpp.o
Scanning dependencies of target math-vector_2d.test
[  9%] Building CXX object CMakeFiles/math-vector_2d.test.dir/test/math/vector_2d.cpp.o
/home/user/wow/tools/noggit3/src/external/qt-color-widgets/src/color_dialog.cpp:313:46: error: 
      'screenNumber' is deprecated: Use QGuiApplication::screenAt() [-Werror,-Wdeprecated-declarations]
    int screenNum = QApplication::desktop()->screenNumber(global_pos);
                                             ^
/usr/include/qt5/QtWidgets/qdesktopwidget.h:75:5: note: 'screenNumber' has been explicitly marked
      deprecated here
    QT_DEPRECATED_X("Use QGuiApplication::screenAt()") int screenNumber(const QPoint &) const;
    ^
/usr/include/qt5/QtCore/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
#  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                ^
/usr/include/qt5/QtCore/qcompilerdetection.h:649:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
#    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                      ^
1 error generated.
make[2]: *** [src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/build.make:193: src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/color_dialog.cpp.o] Error 1
/home/user/wow/tools/noggit3/src/external/qt-color-widgets/src/color_list_widget.cpp:27:24: error: 
      'QSignalMapper' is deprecated [-Werror,-Wdeprecated-declarations]
class ColorListWidget::Private
                       ^
/home/user/wow/tools/noggit3/src/external/qt-color-widgets/src/color_list_widget.cpp:36:41: note: in
      implicit default constructor for 'color_widgets::ColorListWidget::Private' first required here
    : AbstractWidgetList(parent), p(new Private)
                                        ^
/usr/include/qt5/QtCore/qsignalmapper.h:56:5: note: 'QSignalMapper' has been explicitly marked
      deprecated here
    QT_DEPRECATED explicit QSignalMapper(QObject *parent = nullptr);
    ^
/usr/include/qt5/QtCore/qglobal.h:292:25: note: expanded from macro 'QT_DEPRECATED'
#  define QT_DEPRECATED Q_DECL_DEPRECATED
                        ^
/usr/include/qt5/QtCore/qcompilerdetection.h:233:45: note: expanded from macro 'Q_DECL_DEPRECATED'
#  define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
                                            ^
1 error generated.
make[2]: *** [src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/build.make:219: src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/src/color_list_widget.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1023: src/external/qt-color-widgets/CMakeFiles/ColorWidgets-qt5.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 10%] Linking CXX executable bin/math-matrix_4x4.test
[ 10%] Built target math-matrix_4x4.test
[ 10%] Linking CXX executable bin/math-trig.test
[ 10%] Linking CXX executable bin/math-vector_2d.test
[ 10%] Built target math-trig.test
[ 10%] Built target math-vector_2d.test
make: *** [Makefile:95: all] Error 2

I attempted to hackfix it by commenting this line in  CMakeLists.txt:

add_compiler_flag_if_supported (CMAKE_CXX_FLAGS -Werror=deprecated)

But the I get some errors in the code about unused variables and parameters:

[ 45%] Building CXX object CMakeFiles/noggit.dir/src/noggit/ModelInstance.cpp.o
/home/user/wow/tools/noggit3/src/noggit/MapTile.cpp:343:50: error: unused parameter 'selection'
      [-Werror,-Wunused-parameter]
                   , std::vector<selection_type> selection
                                                 ^
[ 45%] Linking CXX executable bin/math-trig.test
1 error generated.
make[2]: *** [CMakeFiles/noggit.dir/build.make:231: CMakeFiles/noggit.dir/src/noggit/MapTile.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:99:11: warning: enumeration values 'holes' and
      'flags' not handled in switch [-Wswitch]
  switch (mode)
          ^
[ 45%] Built target math-trig.test
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:1475:13: warning: 5 enumeration values not handled
      in switch: 'ground', 'flatten_blur', 'paint'... [-Wswitch]
    switch (terrainMode)
            ^
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:1492:13: warning: 6 enumeration values not handled
      in switch: 'holes', 'areaid', 'flags'... [-Wswitch]
    switch (terrainMode)
            ^
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:1639:17: warning: enumeration value 'object' not
      handled in switch [-Wswitch]
        switch (terrainMode)
                ^
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:1537:10: error: unused variable 'canMoveObj'
      [-Werror,-Wunused-variable]
    bool canMoveObj = terrainMode == editing_mode::object;
         ^
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:2140:11: warning: 4 enumeration values not handled
      in switch: 'holes', 'areaid', 'flags'... [-Wswitch]
  switch (terrainMode)
          ^
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:2358:13: warning: 8 enumeration values not handled
      in switch: 'ground', 'flatten_blur', 'paint'... [-Wswitch]
    switch (terrainMode)
            ^
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:2533:10: warning: 4 enumeration values not handled
      in switch: 'holes', 'areaid', 'flags'... [-Wswitch]
        switch (terrainMode)
                ^
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:2555:13: warning: 5 enumeration values not handled
      in switch: 'holes', 'areaid', 'flags'... [-Wswitch]
    switch (terrainMode)
            ^
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:2621:11: warning: 27 enumeration values not handled
      in switch: 'NoButton', 'BackButton', 'ForwardButton'... [-Wswitch]
  switch (event->button())
          ^
/home/user/wow/tools/noggit3/src/noggit/MapView.cpp:2739:11: warning: 27 enumeration values not handled
      in switch: 'NoButton', 'BackButton', 'ForwardButton'... [-Wswitch]
  switch (event->button())
          ^
[ 45%] Linking CXX executable bin/math-vector_2d.test
[ 45%] Built target math-vector_2d.test
10 warnings and 1 error generated.
make[2]: *** [CMakeFiles/noggit.dir/build.make:244: CMakeFiles/noggit.dir/src/noggit/MapView.cpp.o] Error 1
/home/user/wow/tools/noggit3/src/noggit/Model.cpp:813:12: error: unused variable 'texture2_env_map'
      [-Werror,-Wunused-variable]
  uint16_t texture2_env_map = shader_id & 8;
           ^
/home/user/wow/tools/noggit3/src/noggit/Model.cpp:812:12: error: unused variable 'texture1_env_map'
      [-Werror,-Wunused-variable]
  uint16_t texture1_env_map = (shader_id >> 4) & 8;
           ^
/home/user/wow/tools/noggit3/src/noggit/Model.cpp:808:35: error: no previous prototype for function
      'GetPixelShader' [-Werror,-Wmissing-prototypes]
boost::optional<ModelPixelShader> GetPixelShader(uint16_t texture_count, uint16_t shader_id)
                                  ^
/home/user/wow/tools/noggit3/src/noggit/Model.cpp:912:35: error: no previous prototype for function
      'M2GetPixelShaderID' [-Werror,-Wmissing-prototypes]
boost::optional<ModelPixelShader> M2GetPixelShaderID (uint16_t texture_count, uint16_t shader_id)
                                  ^
/home/user/wow/tools/noggit3/src/noggit/Model.cpp:1292:24: error: unused parameter 'draw_fog'
      [-Werror,-Wunused-parameter]
void Model::draw (bool draw_fog, int animtime, bool draw_particles)
                       ^
/home/user/wow/tools/noggit3/src/noggit/Model.cpp:1292:38: error: unused parameter 'animtime'
      [-Werror,-Wunused-parameter]
void Model::draw (bool draw_fog, int animtime, bool draw_particles)
                                     ^
/home/user/wow/tools/noggit3/src/noggit/Model.cpp:1317:25: error: unused parameter 'draw_fog'
      [-Werror,-Wunused-parameter]
                 , bool draw_fog
                        ^
/home/user/wow/tools/noggit3/src/noggit/Model.cpp:1319:25: error: unused parameter 'draw_particles'
      [-Werror,-Wunused-parameter]
                 , bool draw_particles
                        ^
8 errors generated.
make[2]: *** [CMakeFiles/noggit.dir/build.make:270: CMakeFiles/noggit.dir/src/noggit/Model.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:789: CMakeFiles/noggit.dir/all] Error 2
make: *** [Makefile:95: all] Error 2

I haven't attempted any further modifications.

So I don't know if it's an error on my end or if the code on this branch isn't ready for use and I should use another one. Any help would be appreciated.

Share this post


Link to post
Share on other sites

3 answers to this question

  • 0

Disable the warning about deprecated functions by removing

add_compiler_flag_if_supported (CMAKE_CXX_FLAGS -Werror=deprecated)

from the top level cmakelists.txt. Repeat for other warnings that were once fixed but people reintroduced them, like unused-parameter.

Share this post


Link to post
Share on other sites
  • 0

So I managed to remove the warning by commenting a few lines in CMakelists.txt

But now I'm getting these two errors, repeated a few times in several functions and files

/home/user/wow/tools/noggit3/src/noggit/wmo_liquid.cpp:136:45: error: use of undeclared identifier 'FALSE'
  opengl::scoped::bool_setter<GL_CULL_FACE, FALSE> const cull;
                                            ^
/home/user/wow/tools/noggit3/src/noggit/wmo_liquid.cpp:136:58: error: C++ requires a type specifier for all
      declarations
  opengl::scoped::bool_setter<GL_CULL_FACE, FALSE> const cull;
                                                   ~~~~~ 

and

/home/user/wow/tools/noggit3/src/noggit/World.cpp:356:13: error: non-const lvalue reference to type
      'reverse_iterator<...>' cannot bind to a temporary of type 'reverse_iterator<...>'
  for(auto& it = _current_selection.rbegin(); it!=_current_selection.rend(); it++)
            ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm using clang instead of gcc. Perhaps it happens because clang isn't supported? Has anyone before compiled noggit with it?

Share this post


Link to post
Share on other sites
  • 0

Nah, it happens because people only worked on it on windows and thus didn’t see those fuckups. Not a clang issue.

first one should use lowercase bool instead of BOOL, second should use auto instead of auto&. Both are bugs. Please fix/Report.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now