2019-10-24 01:46 AM
Good morning
I'm a newbie in TouchGFX and C++.
I'm developing the TouchGFX tutorial 3 and I'm in the step 2.
When I run simulator, the Designer output return some errors.
In file included from gui/src/model/Model.cpp:1:0:
gui/include/gui/model/Model.hpp:16:19: error: 'int16_t' has not been declared
void saveHour(int16_t saveHour)
^~~~~~~
gui/include/gui/model/Model.hpp:21:21: error: 'int16_t' has not been declared
void saveMinute(int16_t saveMinute)
^~~~~~~
gui/include/gui/model/Model.hpp:26:5: error: 'int16_t' does not name a type
int16_t getHour()
^~~~~~~
gui/include/gui/model/Model.hpp:31:5: error: 'int16_t' does not name a type
int16_t getMinute()
^~~~~~~
gui/include/gui/model/Model.hpp:40:2: error: 'int16_t' does not name a type
int16_t hour;
^~~~~~~
gui/include/gui/model/Model.hpp:41:5: error: 'int16_t' does not name a type
int16_t minute;
^~~~~~~
gui/include/gui/model/Model.hpp: In member function 'void Model::saveHour(int)':
gui/include/gui/model/Model.hpp:18:9: error: 'hour' was not declared in this scope
hour = saveHour;
^~~~
gui/include/gui/model/Model.hpp: In member function 'void Model::saveMinute(int)':
gui/include/gui/model/Model.hpp:23:9: error: 'minute' was not declared in this scope
minute = saveMinute;
^~~~~~
gui/src/model/Model.cpp: In constructor 'Model::Model()':
gui/src/model/Model.cpp:4:36: error: class 'Model' does not have any field named 'hour'
Model::Model() : modelListener(0), hour(0), minute(0)
^~~~
gui/src/model/Model.cpp:4:45: error: class 'Model' does not have any field named 'minute'
Model::Model() : modelListener(0), hour(0), minute(0)
I literally copied the code from tutorial into Model.hpp and Model.cpp.
I attach the 2 files.
Anyone has got an idea what happens?
Thanks
AAlberto
2019-10-24 03:34 AM
Hi to all!
I solved the problem.
I had literally copied the code. The tutorial does not specify to insert the string "#include <stdint.h>" into the Model.hpp. For a newbie like me this is a problem.
At the moment the program compiles correctly even if the animation of the circle does not work ...
It would be useful, for each tutorial, to also have the sources ... but, perhaps, I ask too much.
Thanks
Alberto
2020-09-16 03:07 PM
add #include <cstdint> to the source file. I had the same problem.