Skip to main content
DPosy.1
Associate
November 2, 2021
Question

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

  • November 2, 2021
  • 1 reply
  • 2173 views

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 

This topic has been closed for replies.

1 reply

Romain DIELEMAN
ST Employee
November 2, 2021

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

DPosy.1
DPosy.1Author
Associate
November 2, 2021

My project already converted to C++

Romain DIELEMAN
ST Employee
November 3, 2021

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