Hello, I have updated my STM32CubeIDE from V1.7.0 to V1.9.0. After that my project fails to link with > 40 000 "multiple definition of" errors. Before the project was compiling for years without such problems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-10 6:57 AM
I chaecked the following:
There are no variable definitions in my headers. I use #ifndef/#define/#endif in all headers.
After 2 days of trying I don't know what to do anymore. What might have changed in V1.9.0?
Solved! Go to Solution.
- Labels:
-
STM32CubeIDE
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-10 7:58 AM
This is because you have variables definitions in .h files without extern.
GCC 10 changed this behavior.
You can add -fcommon to revert to the old behavior.
I didn't read carefully your question...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-10 7:07 AM
Look at the error messages. It should tell you where something was first defined along with the definition it just came to. See why there are multiple definitions. Perhaps you have duplicate files in the directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-10 7:51 AM
Thank you for your support.
The error messages are shown for all my variables like this:
main.h:85: multiple definition of `hadc1'; Src\GUIConf.o:C:\Users\JB\STM32CubeIDE\workspace_1.3.0\VM100\Inc/main.h:85: first defined here
In all of them the part "Src\GUIConf.o" is the same.
I checked the file GUIConf.c. It doesn't seem to have any issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-10 7:58 AM
This is because you have variables definitions in .h files without extern.
GCC 10 changed this behavior.
You can add -fcommon to revert to the old behavior.
I didn't read carefully your question...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-10 8:17 AM
No, you were right! With -fcommon I can work again.
Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-10 9:27 AM
So have a look at the last answer of this post:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-22 9:08 AM
same problem here, i spent a whole working day chasing ghosts.
Thanks @Nikita91​
