cancel
Showing results for 
Search instead for 
Did you mean: 

Why the type uint32_t seems to be undefined in Model.hpp file?

HTD
Senior III

I created a new TouchGFX application, opened it with Visual Studio 2022.

The application compiles and runs.

I have Screen1View.hpp file, when I can add a field of type uint32_t, Visual Studio has no problem with that. Then I open Model.hpp file, I try to do the same and it doesn't work.

I'm pretty new to that think, I know "uint32_t" is a custom type defined somewhere in the project, but how exactly is it made available in view and not available in model? Should I include some extra header files, and if so, which ones and how could I solve similar problems in the future?

UPDATE:

Oh, forget it, I tried to press Ctrl+., and VS suggested adding `#include <cstdint>`, now it works.

1 REPLY 1
TDK
Guru

In C++, #include <cstdint> to provide the definition for uint32_t.

In C, #include <stdint.h> to do the same.

The latter is included in your chip-specific CMSIS header file (e.g. stm32f429xx.h) which you should typically be including as a header in your code.

If you feel a post has answered your question, please click "Accept as Solution".