Skip to main content
Rodo
Senior
June 30, 2023
Solved

TouchGFX: undefined reference to `ModelListener::setTime(displayTime_t)' when I add an interaction?

Hi all,

I'm following "Touch GFX #4. Send data to UI" youtube video to send data from the RTC to the display. My project is not complete or tested on the hardware. I'm building it as I go to check for errors. I kept getting the error below for the second screen. I checked all steps in the video and I followed them correctly. I'm not doing anything on the second screen since the video has only one screen. I made another simpler project (zip link to google drive the file size is about 94MB) and that built fine until I added an interaction to the button from the first screen to change to the second screen. I have an interaction in my original project. I started getting the same error as before. I'm pretty new to touchGFX and not much of its code make sense yet. My c++ skills are ok but inheritance, virtual functions and the like not so much. I'm pretty sure I'm missing something. If I remove the interaction or the whole second screen the problem goes away ... but that doesn't really help me.

How do I fix this error? Thanks.


c:\st\stm32cubeide_1.12.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.200.202301161003\tools\arm-none-eabi\bin\ld.exe: ./Application/User/gui/SecondScreenPresenter.o:(.rodata._ZTV21SecondScreenPresenter+0x28): undefined reference to `ModelListener::setTime(displayTime_t)'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:93: STM32F746G_DISCO.elf] Error 1
"make -j20 all" terminated with exit code 2. Build might be incomplete.

This topic has been closed for replies.
JTP1Best answer
Graduate II
June 30, 2023

Good morning

You must change

virtual void setTime(displayTime_t time);

to

virtual void setTime(displayTime_t time){}

in modelListener.hpp. Then you dont have to define SetTime function in every presenter.

https://community.st.com/t5/stm32cubeide-mcu/touchgfx-uart-to-ui-without-rtos/m-p/58712

1 reply

JTP1Best answer
Graduate II
June 30, 2023

Good morning

You must change

virtual void setTime(displayTime_t time);

to

virtual void setTime(displayTime_t time){}

in modelListener.hpp. Then you dont have to define SetTime function in every presenter.

https://community.st.com/t5/stm32cubeide-mcu/touchgfx-uart-to-ui-without-rtos/m-p/58712