Skip to main content
Alberto1
Associate II
October 24, 2019
Question

TouchGFX Tutorial 3 Problems

  • October 24, 2019
  • 2 replies
  • 1159 views

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

This topic has been closed for replies.

2 replies

Alberto1
Alberto1Author
Associate II
October 24, 2019

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

LDoyl
Associate II
September 16, 2020

add #include <cstdint> to the source file. I had the same problem.