2025-09-09 3:19 AM
Hi,
I have upgraded recently to STM32CubeMX 6.15 on Linux and regenerate code for my STM32G491RE project (that uses iostream). Since this, it gives me compilation errors on missing libc symbols (for example putwc).
After investigations, it seems the linker script generated has changed and I wonder if it is expected.
Last part of the script has changed from:
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
to
/DISCARD/ :
{
libc.a:* ( * )
libm.a:* ( * )
libgcc.a:* ( * )
}
Could you confirm this is valid and the expected behavior of the new declaration ?
Regards
2025-09-09 3:23 AM
Welcome to the forum
Please see How to write your question to maximize your chances to find a solution for best results
What version of CubeMX did you upgrade from ?
Not clear if you're trying to use an old CubeMX Project (ioc file) in your new CubeMX ?
If you create a new project from scratch using the the new CubeMX, does that work?
2025-09-09 3:25 AM - edited 2025-09-09 3:26 AM
Hello @Ykrons
Could you please provide more details about the version of you operating system ?
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-09-09 4:50 AM
Hi,
Sorry I have missed a lot of details.
First, I'm using STM32CubeMX v6.15 installed on XUbuntu 24.04.03. CMake is v3.28.3 and gcc v14.2 from arm.
I'm creating a new project in STM32CubeMX for Nucleo-G491RE board keeping all default options, then changes Toolchain/IDE to "CMake" and generate the code.
Then I can successfully build with:
Then I'm adding C++ iostream usage:
A rebuild now fails reporting undefined reference for putwc/getwc.
Then I change the linker script to end with the following extract (:* removed) and it solves the compilation failure:
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
Regards