rodlie / cyan

Cyan Graphics
https://cyan.graphics
Other
90 stars 9 forks source link

-Werror=deprecated-declarations #96

Closed skinkie closed 2 years ago

skinkie commented 3 years ago

I'll log a general bug, because checking out the repository will cause it. The workaround at this moment is:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17af6f8..2cb9e2e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -86,7 +86,7 @@ find_package(Qt5Test REQUIRED)
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../lib/cmake/modules/")

 set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

 option(USE_PKG_CONFIG "Use pkg-config" ON)
 option(USE_Q32 "Q32 workaround if not using pkg-config" OFF)

If you see the following problems:

[ 45%] Building CXX object CMakeFiles/Cyan.dir/src/cyan.cpp.o
/home/skinkie/Sources/cyan/src/cyan.cpp: In member function 'void Cyan::resetImageZoom()':
/home/skinkie/Sources/cyan/src/cyan.cpp:933:20: error: 'void QGraphicsView::setMatrix(const QMatrix&, bool)' is deprecated: Use setTransform() [-Werror=deprecated-declarations]
  933 |     view->setMatrix(matrix);
      |     ~~~~~~~~~~~~~~~^~~~~~~~
In file included from /usr/include/qt5/QtWidgets/QGraphicsView:1,
                 from /home/skinkie/Sources/cyan/src/imageview.h:36,
                 from /home/skinkie/Sources/cyan/src/cyan.h:60,
                 from /home/skinkie/Sources/cyan/src/cyan.cpp:33:
/usr/include/qt5/QtWidgets/qgraphicsview.h:170:48: note: declared here
  170 |     QT_DEPRECATED_X("Use setTransform()") void setMatrix(const QMatrix &matrix, bool combine = false);
      |                                                ^~~~~~~~~
/home/skinkie/Sources/cyan/src/cyan.cpp: In member function 'void Cyan::getConvertProfiles()':
/home/skinkie/Sources/cyan/src/cyan.cpp:1141:29: error: 'QMap<K, V>& QMap<K, V>::unite(const QMap<K, V>&) [with Key = QString; T = QString]' is deprecated: Use QMultiMap for maps storing multiple values with the same key. [-Werror=deprecated-declarations]
 1141 |         outputProfiles.unite(genProfiles(FXX::GRAYColorSpace));
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt5/QtCore/qvariant.h:47,
                 from /usr/include/qt5/QtWidgets/qaction.h:47,
                 from /usr/include/qt5/QtWidgets/qtoolbar.h:44,
                 from /usr/include/qt5/QtWidgets/QToolBar:1,
                 from /home/skinkie/Sources/cyan/src/cyan.h:37,
                 from /home/skinkie/Sources/cyan/src/cyan.cpp:33:
/usr/include/qt5/QtCore/qmap.h:1374:15: note: declared here
 1374 | QMap<Key, T> &QMap<Key, T>::unite(const QMap<Key, T> &other)
      |               ^~~~~~~~~~~~
/home/skinkie/Sources/cyan/src/cyan.cpp:1145:29: error: 'QMap<K, V>& QMap<K, V>::unite(const QMap<K, V>&) [with Key = QString; T = QString]' is deprecated: Use QMultiMap for maps storing multiple values with the same key. [-Werror=deprecated-declarations]
 1145 |         outputProfiles.unite(genProfiles(FXX::GRAYColorSpace));
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt5/QtCore/qvariant.h:47,
                 from /usr/include/qt5/QtWidgets/qaction.h:47,
                 from /usr/include/qt5/QtWidgets/qtoolbar.h:44,
                 from /usr/include/qt5/QtWidgets/QToolBar:1,
                 from /home/skinkie/Sources/cyan/src/cyan.h:37,
                 from /home/skinkie/Sources/cyan/src/cyan.cpp:33:
/usr/include/qt5/QtCore/qmap.h:1374:15: note: declared here
 1374 | QMap<Key, T> &QMap<Key, T>::unite(const QMap<Key, T> &other)
      |               ^~~~~~~~~~~~
/home/skinkie/Sources/cyan/src/cyan.cpp:1149:29: error: 'QMap<K, V>& QMap<K, V>::unite(const QMap<K, V>&) [with Key = QString; T = QString]' is deprecated: Use QMultiMap for maps storing multiple values with the same key. [-Werror=deprecated-declarations]
 1149 |         outputProfiles.unite(genProfiles(FXX::CMYKColorSpace));
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt5/QtCore/qvariant.h:47,
                 from /usr/include/qt5/QtWidgets/qaction.h:47,
                 from /usr/include/qt5/QtWidgets/qtoolbar.h:44,
                 from /usr/include/qt5/QtWidgets/QToolBar:1,
                 from /home/skinkie/Sources/cyan/src/cyan.h:37,
                 from /home/skinkie/Sources/cyan/src/cyan.cpp:33:
/usr/include/qt5/QtCore/qmap.h:1374:15: note: declared here
 1374 | QMap<Key, T> &QMap<Key, T>::unite(const QMap<Key, T> &other)
      |               ^~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/Cyan.dir/build.make:140: CMakeFiles/Cyan.dir/src/cyan.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/Cyan.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
rodlie commented 2 years ago

fixed in 1.2 and main.