2021-10-06 02:56 AM
Greetings All
I am implementing an ADC-based GUI on my board and my code is not building due to the abovementioned error (even when the file exists. I am using STMCubeMX(6.3.0), STM32CubeIDE (1.7.0) and TouchGFX(4.17.0) to develop my GUI. Most of these files are in the simulator folder so I figure there must be a way to omit them as I suspect that they may be giving me problems. This is for my final-year project and I am pressed for a solution. Any assistance will be greatly appreciated.
2021-10-06 02:34 PM
How do I solve this problem?
2021-10-06 02:37 PM
2021-10-06 02:42 PM
Hi TDK
I used STMCubeMX and TouhGFX to set the GUI and ADC up so they both compiled codes which are not congruent. Alluding to me taking accountability, it's all I have done (frustratingly) for the past 3 weeks so I asked the question in a suggestive manner. Thank you for the suggestion.
2021-10-07 02:06 AM
@TDK "You have multiple source files redefining functions. Having two main.c files within a project should not happen"
indeed.
Another common cause is to have definitions in headers
2021-10-07 02:09 AM
The messages tell you where all the multiple definitions are; eg,
c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: ./Core/Src/main.o: in function `StartDefaultTask':
C:/ST/System/System/STM32CubeIDE/Debug/../Core/Src/main.c:1086: multiple definition of `StartDefaultTask'; ./Application/User/main.o:C:/ST/System/System/Core/Src/main.c:1086: first defined here
So you need to look at those definitions, and decide which one to keep, and which one(s) to get rid of.
2021-10-07 02:13 AM
@TDK "two main.c files"
Ah yes - that does, indeed, seem to be the case:
"c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: ./Core/Src/main.o: in function `StartDefaultTask':
C:/ST/System/System/STM32CubeIDE/Debug/../Core/Src/main.c:1086: multiple definition of `StartDefaultTask'; ./Application/User/main.o:C:/ST/System/System/Core/Src/main.c:1086: first defined here
So you have a main.c in ./Application/User/
and another main.c in ./Core/Src/
So you need to look at the two and decide which to keep, and which to get rid of ...
As noted previously, that one change will fix all of those errors