Multiple definition after update CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-29 08:35 AM
Hi. Can you say me what mean that type of error.
The code is surely correct because I've been working on it. The errors showed up after updating CubeIDE to a new version and generating files from .ioc file in IDE.
c:\st\stm32cubeide_1.7.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\tools\arm-none-eabi\bin\ld.exe: ./Core/Src/communication/sms.o:C:/master_g474ve/Debug/../Core/Inc/config.h:54: multiple definition of `config'; ./Core/Src/battery_charger.o:C:/master_g474ve/Debug/../Core/Inc/config.h:54: first defined here
Solved! Go to Solution.
- Labels:
-
STM32CubeIDE
-
STM32G4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-29 10:04 AM
Probably this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-29 09:23 AM
Is config.h a CubeMX generated file? Certainly neither sms.c nor battery_charger.c is.
Probably you have the "config" variable/function defined in config.h, which is being included in two compilation units, which leads to duplicate definitions.
Move your definitions into source files and keep only the declaration in the header.
> The code is surely correct because I've been working on it.
Not sure that logic tracks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-29 10:04 AM
Probably this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-29 11:53 PM
Yes. It's answer to my question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-07-17 10:35 PM - edited ‎2023-07-17 10:36 PM
Please go through https://gcc.gnu.org/gcc-10/porting_to.html
In STM32CubeIDE, Goto Project Properties-> --> C/C++ Build -->Settings--> MCU GCC Compiler--> Miscellaneous--> other flags --> Add -fcommon Apply and Close.
Hope this will help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-27 02:47 AM
Hallo Mitarbeiter II, das hat bei mir geholfen, es kam die Fehlermeldung, einer doppelten Definition in einer .o Datei.
-fcommon eingetragen, und keine Fehlermeldung mehr, GENIAL. Was bewirkt dieser Eintrag ? Danke nochmal von ganzem Herzen. Liebe Grüße
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-27 02:59 AM
Habe gerade den Link gelesen, alles klar, danke.