Skip to main content
egoltzman
Senior
October 17, 2019
Question

Undefined reference when porting from 4.9.3 to 4.12.3

  • October 17, 2019
  • 11 replies
  • 2275 views

Hi Martin,

Congratulations for the new release!

I'm trying to port an 4.9.3 project to 4.12.3 and I got some undefined reference error when compile with CubeIDE 1.1, is there a porting guidelines somewhere?

Do you see any thing in the list that might help me to resolve it?

BTW, the simulation under visual studio built with no error and runs OK.

Thanks,

Eyal

  • undefined reference to `touchgfx::Circle::getMinimalRectForUpdatedEndAngle(touchgfx::CWRUtil::Q5 const&) const' Circle.hpp
  • undefined reference to `touchgfx::ConstFont::ConstFont(touchgfx::GlyphNode const*, unsigned short, unsigned short, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned short, unsigned short)' GeneratedFont.cpp
  • undefined reference to `touchgfx::LCD::drawString(touchgfx::Rect, touchgfx::Rect const&, touchgfx::LCD::StringVisuals const&, unsigned short const*, ...)' TextAreaWithWildcard.hpp
  • undefined reference to `touchgfx::LCD::drawString(touchgfx::Rect, touchgfx::Rect const&, touchgfx::LCD::StringVisuals const&, unsigned short const*, ...)' TextAreaWithWildcard.hpp
  • undefined reference to `touchgfx::muldiv(long, long, long, long&)' CWRUtil.hpp
  • undefined reference to `touchgfx::ScrollableContainer::setScrollbarsPermanentlyVisible()' AboutScreenViewBase.cpp
  • undefined reference to `touchgfx::ScrollableContainer::setScrollbarsVisible(bool)' AboutScreenViewBase.cpp

This topic has been closed for replies.

11 replies

Martin KJELDSEN
Principal III
October 17, 2019

Hi Eyal, thanks!

There shouldn't be any porting required, but sometimes the intention to be compliant with semantic versioning fails =) Or maybe there is some sort of step involved - Specifically when coming from 4.9.3 which is a PRE-ST release (non stm32 locked).

Did you make sure to press "Generate code" from the designer? (This is a manual step now). It should update your project to include the right files where as Makefiles using gcc from the simulator always just work.

/Martin

egoltzman
egoltzmanAuthor
Senior
October 17, 2019

Yes Martin, I generated the code under the designer (It works much faster!) and as I mention in my case I also was able to compile and run the simulation.

Martin KJELDSEN
Principal III
October 17, 2019

I would expect the simulation to run fine because it relies on Makefiles which are more generic

There may be something wrong with how the cubeide project is updated. What does your post-generation step say? (in .touchgfx).

/Martin

egoltzman
egoltzmanAuthor
Senior
October 17, 2019

There is no special instruction for the CubeIDE there, should I add something?

This is how it is look like now:

"PostGenerateCommand": "touchgfx update_project --project-file=simulator/msvs/Application.vcxproj",

Martin KJELDSEN
Principal III
October 17, 2019

Hi Eyal,

Yes, so the upgrade process does not do anything with your post-generate command. It can't guess that you were using CubeIDE. 4.12.3 now supports a project updater that can update CubeIDE projects. I'm not sure where your project is located, but you could do something like this:

"PostGenerateCommand": "touchgfx update_project --project-file=simulator/msvs/Application.vcxproj && touchgfx update_project --project-file=../STM32CubeIDE/.cproject"

/Martin

egoltzman
egoltzmanAuthor
Senior
October 18, 2019

Hi Martin,

I updated the PostGenerateCommand as suggested but I still have those undefined references.

I think that what I should try to do is to compare my CubeIDE project with a working example of TouchGFX CubeIDE project, is there any? Or is there any guidelines how to generate a new one?

Thanks,

Eyal

MartinS
Visitor II
October 21, 2019

​Hi,

I'm also unable to compile my project under 4.12.3 because of the same compilation errors (as described by @egoltzman​  ) . Till now I didn't have such problems with moving to the newer version. I use Atollic TrueStudio 9.3 and don't use CubeMX.

MartinS
Visitor II
October 21, 2019

​Hi,

I was trying to cope with this problem for a whole day. After writing a message I found solution in this place ( https://touchgfx.zendesk.com/hc/en-us/community/posts/115000231465-Integrating-TouchGFX-with-SimplicityStudio ) Simply I forgot to update library version for linker. It is defined in build settings of Atollic TrueStudio. Maybe it will help you.

egoltzman
egoltzmanAuthor
Senior
October 21, 2019

Thank you Martin, the library was my first suspect so I already checked this but its look like the link is using the right library

eng23
Senior
October 23, 2019

Hi,

I have problems with multiple definitions too when updating to 4.12.3, but now it is resolved.

I had problem with multiple definitions in OSWrappers.cpp because when updated I have the OSWrappers_cmsis.cpp in the same folder with same functions... I need to delete one to get it work. I've tested with both files and no difference. Any advice which one should be used?

Martin KJELDSEN
Principal III
October 23, 2019

Doesn't matter, really. If you have cmsis os in your project you can use that, but native (non cmsis) oswrapper works just as well.

/Martin