cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix "multiple definition of `errno"'?

DK.7
Senior

I try to create a new project, nothing is written in main.c! It is a first check after setting up 'LWIP', 'SDIO' and Freertos in the GUI and got this mistake!

multiple definition of `errno'; ./Middlewares/Third_Party/LwIP/system/OS/sys_arch.o:/home/denis/STM32CubeIDE/workspace_1.9.0/FreeRtos_SDIO_Web/Debug/../Middlewares/Third_Party/LwIP/system/OS/sys_arch.c:45: first defined here

STM32CubeIDE Version: 1.9.0

PS - This error not appear then I was on STM32CubeIDE Version: 1.8.0

22 REPLIES 22

I am a beginner and the answer from waclawek.jan did not helped to me out! After that I asked to make the screenshot ...

PS - Could you please make screen? Because I don't understand what you are mean...

You can just add extern before the int errno.

i tried this solution but did not solve problem .

 

problem:-

13:39:46 **** Incremental Build of configuration Debug for project 15_04_24_RTOS_TEST ****
make -j4 all
arm-none-eabi-gcc -o "15_04_24_RTOS_TEST.elf" @"objects.list" -mcpu=cortex-m4 -T"D:\STM32 RTOS\15_04_24_RTOS_TEST\STM32F411CEUX_FLASH.ld" --specs=nosys.specs -Wl,-Map="15_04_24_RTOS_TEST.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -u _printf_float -u _scanf_float -Wl,--start-group -lc -lm -Wl,--end-group
C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Core/Src/main.o: in function `vApplicationGetIdleTaskMemory':
D:/STM32 RTOS/15_04_24_RTOS_TEST/Debug/../Core/Src/freertos.c:123: multiple definition of `vApplicationGetIdleTaskMemory'; ./Core/Src/freertos.o:D:/STM32 RTOS/15_04_24_RTOS_TEST/Debug/../Core/Src/freertos.c:123: first defined here
C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Middlewares/Third_Party/FreeRTOS/Source/timers.o: in function `xTimerCreateTimerTask':
D:/STM32 RTOS/15_04_24_RTOS_TEST/Debug/../Middlewares/Third_Party/FreeRTOS/Source/timers.c:245: undefined reference to `vApplicationGetTimerTaskMemory'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:68: 15_04_24_RTOS_TEST.elf] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.