Skip to content

Conversation

richelbilderbeek
Copy link

GCC for C++17 gave me the error as shown below. Ordering the member variables solves this problem.

make[1]: Entering directory '/home/richel/GitHubs/conquer_chess/build/Desktop-Debug'
g++ -c -pipe -std=c++17 -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -Werror -fprofile-arcs -ftest-coverage -g -std=gnu++1z -Wall -Wextra -fPIC -D_REENTRANT -DUSE_SFGRAPHING -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../conquer_chess -I. -I../../include -I../../../SFGraphing/include -I/usr/include/x86_64-linux-gnu/qt6 -I/usr/include/x86_64-linux-gnu/qt6/QtWidgets -I/usr/include/x86_64-linux-gnu/qt6/QtGui -I/usr/include/x86_64-linux-gnu/qt6/QtCore -Idebug -I/usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -o debug/PlotDataSet.o ../../../SFGraphing/src/PlotDataSet.cpp
In file included from ../../../SFGraphing/src/PlotDataSet.cpp:1:
../../../SFGraphing/include/SFGraphing/PlotDataSet.h: In constructor ‘csrc::PlotDataSet::PlotDataSet(const std::vector<float>&, const std::vector<float>&, const sf::Color&, const std::string&, const csrc::PlottingType&)’:
../../../SFGraphing/include/SFGraphing/PlotDataSet.h:30:24: error: ‘csrc::PlotDataSet::_xValues’ will be initialized after [-Werror=reorder]
   30 |     std::vector<float> _xValues;
      |                        ^~~~~~~~
../../../SFGraphing/include/SFGraphing/PlotDataSet.h:29:24: error:   ‘std::vector<float> csrc::PlotDataSet::_yValues’ [-Werror=reorder]
   29 |     std::vector<float> _yValues;
      |                        ^~~~~~~~
../../../SFGraphing/src/PlotDataSet.cpp:17:1: error:   when initialized here [-Werror=reorder]
   17 | PlotDataSet::PlotDataSet(const std::vector<float>& xValues, const std::vector<float>& yValues, const sf::Color& color, const std::string& label,
      | ^~~~~~~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant