cancel
Showing results for 
Search instead for 
Did you mean: 

How to use touchGFX in c++ projects? (touchGFX 4.18 + STM32CubeIDE1.7.0)

DPosy.1
Associate

Hello,

when i need to include cpp headers in main.c to use classes and cpp functions, I usually convert project to c++, rename main.c to main.cpp and everything works good.

Now I started project with TouchGFX. The only way to compile project without any errors is using main.c (not main.cpp). Else there are some errors, maybe connected with architecture of TouchGFX (i found main.cpp file ProjectName\TouchGFX\simulator\main.cpp).

0693W00000GWCcZQAX.png0693W00000GWCaxQAH.png 

3 REPLIES 3
Romain DIELEMAN
ST Employee

Hi,

Your project needs to be in C++ to use TouchGFX. The error message "undefined reference to "MX_TouchGFX_Process()" indicates that your project is C.

/Romain

My project already converted to C++

Could you share your project ? Are you using an RTOS ? Could you check the name of the entry function (it should be TouchGFX_Task) ?

/Romain