2020-04-22 06:08 AM
Hello,
I'm trying to setup a system with STM32F7 with hardware FPU, TouchGFX and VisualGDB. I can compile, however during linking I get the following error:
TouchGFXConfiguration.cpp
Linking VisualGDB/Debug/Ozonclean...
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: VisualGDB/Debug/TouchGFXConfiguration.o: in function `FrontendApplication::handleTickEvent()':
Z:/Progetti_in_corso/OZONCLEAN/FW/Rev00/TouchGFX/gui/include/gui/common/FrontendApplication.hpp:18: undefined reference to `Model::tick()'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: VisualGDB/Debug/TouchGFXConfiguration.o: in function `FrontendHeapBase::gotoStartScreen(FrontendApplication&)':
Z:/Progetti_in_corso/OZONCLEAN/FW/Rev00/TouchGFX/generated/gui_generated/include/gui_generated/common/FrontendHeapBase.hpp:75: undefined reference to `FrontendApplicationBase::gotoMainScreenNoTransition()'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: VisualGDB/Debug/TouchGFXConfiguration.o: in function `FrontendHeap::getInstance()':
Z:/Progetti_in_corso/OZONCLEAN/FW/Rev00/TouchGFX/gui/include/gui/common/FrontendHeap.hpp:56: undefined reference to `__dso_handle'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: VisualGDB/Debug/TouchGFXConfiguration.o: in function `FrontendHeap::FrontendHeap()':
Z:/Progetti_in_corso/OZONCLEAN/FW/Rev00/TouchGFX/gui/include/gui/common/FrontendHeap.hpp:65: undefined reference to `FrontendApplication::FrontendApplication(Model&, FrontendHeap&)'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: Z:/Progetti_in_corso/OZONCLEAN/FW/Rev00/TouchGFX/gui/include/gui/common/FrontendHeap.hpp:65: undefined reference to `Model::Model()'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: VisualGDB/Debug/TouchGFXConfiguration.o:(.data._ZL12fontProvider+0x0): undefined reference to `vtable for ApplicationFontProvider'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: VisualGDB/Debug/TouchGFXConfiguration.o: in function `touchgfx_init':
//SERVER-PC/Ufficio_tecnico/Progetti_in_corso/OZONCLEAN/FW/Rev00/TouchGFX/target/generated/TouchGFXConfiguration.cpp:40: undefined reference to `BitmapDatabase::getInstance()'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: //SERVER-PC/Ufficio_tecnico/Progetti_in_corso/OZONCLEAN/FW/Rev00/TouchGFX/target/generated/TouchGFXConfiguration.cpp:40: undefined reference to `BitmapDatabase::getInstanceSize()'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: //SERVER-PC/Ufficio_tecnico/Progetti_in_corso/OZONCLEAN/FW/Rev00/TouchGFX/target/generated/TouchGFXConfiguration.cpp:42: undefined reference to `touchgfx::Texts::setLanguage(unsigned short)'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: VisualGDB/Debug/TouchGFXConfiguration.o: in function `__static_initialization_and_destruction_0':
//SERVER-PC/Ufficio_tecnico/Progetti_in_corso/OZONCLEAN/FW/Rev00/TouchGFX/target/generated/TouchGFXConfiguration.cpp:61: undefined reference to `__dso_handle'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: VisualGDB/Debug/TouchGFXConfiguration.o: in function `ApplicationFontProvider::~ApplicationFontProvider()':
Z:/Progetti_in_corso/OZONCLEAN/FW/Rev00/TouchGFX/generated/fonts/include/fonts/ApplicationFontProvider.hpp:18: undefined reference to `vtable for ApplicationFontProvider'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libc_nano.a(lib_a-init.o): in function `__libc_init_array':
init.c:(.text.__libc_init_array+0x14): undefined reference to `_init'
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: VisualGDB/Debug/Ozonclean: hidden symbol `__dso_handle' isn't defined
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: final link failed: bad value
Build failed: arm-none-eabi-g++.exe exited with code 1
collect2.exe: error: ld returned 1 exit status
========== Project Build Summary ==========
Ozonclean built in 00:04
========== Build: 0 Succeeded, 1 Failed ==========
If I don't misunderstand, the linker can't find the references "FrontendApplication", "Model" and "BitmapDatabase". How can I correct this problem?
Thank you,
Mattia Berton
Solved! Go to Solution.
2020-04-22 06:49 AM
Yep! Add TouchGFX Generated files (generated/), gui files (gui/) and remember to link with the appropriate library (touchgfx/lib/core)
And include gccstubs.cpp (touchgfx/config/gcc/) - It has some symbols you need, like
void* __dso_handle = (void*)NULL;
Maybe you should get some inspiration from our existing Makefiles (choose any application template) that use gcc.
2020-04-22 06:21 AM
touchgfx/config/gcc/gccstubs.cpp
And you may be missing all the generated code in your project. E.g.
undefined reference to `vtable for ApplicationFontProvider'
ApplicationFontProvider.cpp is a generated file.
/Martin
2020-04-22 06:31 AM
So what should I do? Should I add the TouchGFX/generated folder in my project?
2020-04-22 06:49 AM
Yep! Add TouchGFX Generated files (generated/), gui files (gui/) and remember to link with the appropriate library (touchgfx/lib/core)
And include gccstubs.cpp (touchgfx/config/gcc/) - It has some symbols you need, like
void* __dso_handle = (void*)NULL;
Maybe you should get some inspiration from our existing Makefiles (choose any application template) that use gcc.
2020-04-27 07:03 PM
Did you get any further with this @eddiemat ?
/Martin
2021-07-19 05:33 AM
please help on this:
chGFX/App/app_touchgfx.c:29: undefined reference to `touchgfx_init'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:86: TEST_MAX_AI_430.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.