cancel
Showing results for 
Search instead for 
Did you mean: 

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.

JBurg.5
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Nikita91
Lead II

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...

View solution in original post

6 REPLIES 6
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".
JBurg.5
Associate II

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.

Nikita91
Lead II

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...

JBurg.5
Associate II

No, you were right! With -fcommon I can work again.

Thanks a lot!

Nikita91
Lead II

So have a look at the last answer of this post:

Issue with version 1.9.0? (st.com)

same problem here, i spent a whole working day chasing ghosts.

Thanks @Nikita91​ 

we dont need to firmware by ourselves, lets talk