1 year, 11 months ago.  This question has been closed. Reason: Duplicate question

Necleo-rtos-basic's multiple definition of `software_init_hook' with mbed-cli

Hello,

It's OK with online-compiler. But when I try it with mbed-cli, I got ERROR as below multiple definition of `software_init_hook' during liking. What's the problem?

ewrcu@PC C:\Users\ewrcu\Mbed

[mbed] Importing program "Nucleo_rtos_basic" from "https://os.mbed.com/teams/ST/code/Nucleo_rtos_basic" at latest revision in the current branch [mbed] Adding library "mbed-rtos" from "https://mbed.org/users/mbed_official/code/mbed-rtos" at rev #bdd541595fc5 [mbed] Adding library "mbed" from "https://mbed.org/users/mbed_official/code/mbed/builds" at rev #86740a56073b [mbed] Downloading library build "86740a56073b" (might take a minute) [mbed] Unpacking library build "86740a56073b" in "C:\Users\ewrcu\Mbed\Nucleo_rtos_basic\mbed" [mbed] Couldn't find build tools in your program. Downloading the mbed 2.0 SDK tools...

ewrcu@PC C:\Users\ewrcu\Mbed

cd Nucleo_rtos_basic

ewrcu@PC C:\Users\ewrcu\Mbed\Nucleo_rtos_basic

mbed compile -t GCC_ARM -m NUCLEO_F103RB

Building project Nucleo_rtos_basic (NUCLEO_F103RB, GCC_ARM) Scan: . Scan: mbed Scan: env Compile [ 4.8%]: main.cpp Compile [ 9.5%]: RtosTimer.cpp Compile [ 14.3%]: Mutex.cpp Compile [ 19.0%]: Semaphore.cpp Compile [ 23.8%]: Thread.cpp Compile [ 28.6%]: HAL_CM3.S Compile [ 33.3%]: SVC_Table.S Compile [ 38.1%]: rtos_idle.c Compile [ 42.9%]: HAL_CM.c Compile [ 47.6%]: RTX_Conf_CM.c Compile [ 52.4%]: rt_Event.c Compile [ 57.1%]: rt_CMSIS.c Compile [ 61.9%]: rt_List.c Compile [ 66.7%]: rt_Mailbox.c Compile [ 71.4%]: rt_MemBox.c Compile [ 76.2%]: rt_Robin.c Compile [ 81.0%]: rt_Mutex.c Compile [ 85.7%]: rt_Semaphore.c Compile [ 90.5%]: rt_System.c Compile [ 95.2%]: rt_Time.c Compile [100.0%]: rt_Task.c Link: Nucleo_rtos_basic ./mbed/86740a56073b/TARGET_NUCLEO_F103RB/TOOLCHAIN_GCC_ARM/mbed_retarget.o: In function `software_init_hook': mbed_retarget.cpp:(.text.software_init_hook+0x0): multiple definition of `software_init_hook' ./BUILD/NUCLEO_F103RB/GCC_ARM/mbed-rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.o:RTX_Conf_CM.c:(.text.software_init_hook+0x0): first defined here collect2.exe: error: ld returned 1 exit status [ERROR] ./mbed/86740a56073b/TARGET_NUCLEO_F103RB/TOOLCHAIN_GCC_ARM/mbed_retarget.o: In function `software_init_hook': mbed_retarget.cpp:(.text.software_init_hook+0x0): multiple definition of `software_init_hook' ./BUILD/NUCLEO_F103RB/GCC_ARM/mbed-rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.o:RTX_Conf_CM.c:(.text.software_init_hook+0x0): first defined here collect2.exe: error: ld returned 1 exit status

[mbed] ERROR: "C:\Python27\python.exe" returned error code 1. [mbed] ERROR: Command "C:\Python27\python.exe -u C:\Users\ewrcu\Mbed\Nucleo_rtos_basic\.temp\tools\make.py -t GCC_ARM -m NUCLEO_F103RB source . build .\BUILD\NUCLEO_F103RB\GCC_ARM" in "C:\Users\ewrcu\Mbed\Nucleo_rtos_basic" -

ewrcu@PC C:\Users\ewrcu\Mbed\Nucleo_rtos_basic

Best Regards, JY

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F103RBT6 microcontroller.