Skip to main content
0910655
Associate
Apr 18, 2019 1:27 PM UTC
Solved

Tutorial 3 gives errors. I don't know what I do wrong? Can somebody help me?

Detailed log

Converting images

Compiling gui/src/model/Model.cpp

In file included from gui/src/model/Model.cpp:1:0:

gui/include/gui/model/Model.hpp: In constructor 'Model::Model()':

gui/include/gui/model/Model.hpp:65:20: error: 'Model::modelListener' will be initialized after [-Werror=reorder]

   ModelListener* modelListener;

          ^~~~~~~~~~~~~

gui/include/gui/model/Model.hpp:60:10: error:  'int16_t Model::hour' [-Werror=reorder]

 int16_t hour;

     ^~~~

gui/src/model/Model.cpp:8:1: error:  when initialized here [-Werror=reorder]

 Model::Model() : modelListener(0), hour(0)//, minute(0)

 ^~~~~

cc1plus.exe: all warnings being treated as errors

simulator/gcc/Makefile:220: recipe for target 'build/MINGW32_NT-6.2/gui/src/model/Model.o' failed

make[2]: *** [build/MINGW32_NT-6.2/gui/src/model/Model.o] Error 1

simulator/gcc/Makefile:182: recipe for target 'generate_assets' failed

make[1]: *** [generate_assets] Error 2

simulator/gcc/Makefile:40: recipe for target 'all' failed

make: *** [all] Error 2

Model.ccp

#include <gui/model/Model.hpp>

#include <gui/model/ModelListener.hpp>

void Model::tick()

{

}

Model::Model() : modelListener(0), hour(0), minute(0)

{

}

This topic has been closed for replies.
Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Apr 23, 2019 8:27 AM UTC

Hi @0910655​,

Looks like a simple case of gcc initialization order. Check that you've declared the variables in the same order you're initializing them in (in your Model constructor)

Best regards,

Martin

3 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Apr 23, 2019 8:27 AM UTC

Hi @0910655​,

Looks like a simple case of gcc initialization order. Check that you've declared the variables in the same order you're initializing them in (in your Model constructor)

Best regards,

Martin

0910655
0910655Author
Associate
May 6, 2019 6:53 AM UTC

Thank you very much. This is the solution.