2022-02-06 02:12 PM
This is a project created with STM32CubeMX and then coding in the STM32CubeIDE environment.
The error is in the linking process, but wondering why the linker should believe this function is defined twice by default. I had reason to believe these should be local to their own translation units/source files and so the linker treated these are entirely different functions.
I am aware that functions in different source files with the same names is undesirable, but I would prefer to get top the bottom of this rather than simple rename the functions.
Solved! Go to Solution.
2022-02-06 02:14 PM
Unless defined as static, body functions will be visible in the global name-space.
2022-02-06 02:14 PM
Unless defined as static, body functions will be visible in the global name-space.
2022-02-06 02:20 PM
Many thanks for your quick reply, I thought functions would be local static by default. On some further research I can see this that functions are indeed global.
Many thanks again.
2022-02-07 12:17 AM
@Community member "On some further research I can see this that functions are indeed global"
Indeed: this is standard C - nothing specific to CubeIDE.
2022-02-07 10:30 PM
> I thought functions would be local static by default.
This is a difference between C and C++.
In C, functions are 'extern' unless declared static.