Can't link – libc linking issues (probably)

Sysprogs forums Forums VisualGDB Can't link – libc linking issues (probably)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10198
    tomasb
    Participant

    Hi,

    I’ve created project using STM32CubeMX, imported using VisualGDB into VS2015 according to tutorial found here, but can’t build project. Adding -verbose to linker options reveals some issues I don’t understand.

    1> attempt to open c:/_dev/sysgcc/bin/../lib/gcc/arm-eabi/6.2.0/thumb/cortex_m3/libm.so failed
    1> attempt to open c:/_dev/sysgcc/bin/../lib/gcc/arm-eabi/6.2.0/thumb/cortex_m3\libm.a failed
    1> attempt to open c:/_dev/sysgcc/bin/../lib/gcc/arm-eabi/6.2.0/../../../../arm-eabi/lib/thumb/cortex_m3/libm.so failed
    1> attempt to open c:/_dev/sysgcc/bin/../lib/gcc/arm-eabi/6.2.0/../../../../arm-eabi/lib/thumb/cortex_m3\libm.a succeeded
    1> attempt to open c:/_dev/sysgcc/bin/../lib/gcc/arm-eabi/6.2.0/thumb/cortex_m3/libgcc.so failed

    1> Debug/system_stm32f1xx.o:(.data+0x0): multiple definition of `SystemCoreClock’
    1> Debug/system_stm32f1xx.o:(.data+0x0): first defined here
    1> Debug/system_stm32f1xx.o:(.rodata+0x0): multiple definition of `AHBPrescTable’
    1> Debug/system_stm32f1xx.o:(.rodata+0x0): first defined here
    1> Debug/system_stm32f1xx.o:(.rodata+0x10): multiple definition of `APBPrescTable’
    1> Debug/system_stm32f1xx.o:(.rodata+0x10): first defined here
    1> Debug/system_stm32f1xx.o: In function `SystemInit’:
    1> system_stm32f1xx.c:(.text.SystemInit+0x0): multiple definition of `SystemInit’
    1> Debug/system_stm32f1xx.o:system_stm32f1xx.c:(.text.SystemInit+0x0): first defined here
    1> attempt to open c:/_dev/sysgcc/bin/../lib/gcc/arm-eabi/6.2.0/../../../../arm-eabi/lib/thumb/cortex_m3/libc_nano.so failed
    1> Debug/system_stm32f1xx.o: In function `SystemCoreClockUpdate’:
    1> system_stm32f1xx.c:(.text.SystemCoreClockUpdate+0x0): multiple definition of `SystemCoreClockUpdate’
    1> Debug/system_stm32f1xx.o:system_stm32f1xx.c:(.text.SystemCoreClockUpdate+0x0): first defined here
    1>collect2.exe : error : ld returned 1 exit status

    Can anyone give me a hint how to solve this?

    Thanks.

    T.

    • This topic was modified 7 years, 10 months ago by tomasb.
    #10201
    tomasb
    Participant

    After some more investigation, I have found:

    • though target has been specified as STM32F103C8, somehow stm32756g_eval.h, stm32756g_eval_io.h, stm32756g_eval_sd.h are automatically added in External Dependecies, but I don’t know if this is source of a problem of not linking the project
    • when LED BLINK sample is created for STM32F103C8, and CUBE32MX project files are injected the ‘hard’ way, this example project compiles and links

    Seems to me, there could be some issues in project create scripts for STM32F103C8 target.

    T.

    #10204
    support
    Keymaster

    Hi,

    This looks like a conflict between files generated by VisualGDB wizard and the files imported from CubeMX.

    The ‘multiple definition’ error can be resolved very easily by unchecking the ‘default system file’ checkbox on the Embedded Frameworks page of VisualGDB Project Properties.

    The ‘external dependencies’ list is derived by Visual Studio by trying to locate included headers, so it can be incorrect, but this should not affect compilation or IntelliSense.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.