FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [June 2009 Threads] linker error: multiple definition of `putcharPosted by Andriy Korud on June 4, 2009 Hi, I'm trying to compile FreeRTOS 5.3.0 STM32 Primer example (unmodified). RIDE and development environment is fresh and clear: Ride7 7.20.09.0139 Rkit-ARM 1.20.09.0153
Everything compile fine, except linking: Running: LD \"C:\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe" -mcpu=cortex-m3 -mthumb -Wl,-T -Xlinker "C:\work\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\RTOSDemo.elf.ld" -u _start -Wl,-static -Wl,--gc-sections -nostartfiles -Wl,-Map -Xlinker "C:\work\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\RTOSDemo.map" C:\Raisonance\Ride\Lib\ARM\STM32x_io_putchar_thumb.a(STM32F10X_IO_putchar.o): In function `putchar': STM32F10X_IO_putchar.c:(.text.putchar+0x0): multiple definition of `putchar' c:/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-putchar.o):putchar.c:(.text+0x0): first defined here collect2: ld returned 1 exit status
The I have no idea how to prevent linker from linking libc putchar, any ideas?
Regards, Andriy
RE: linker error: multiple definition of `putPosted by Richard on June 4, 2009 The error is telling you where to two definitions are. One is in the libc library, and the other in STM32F10X_IO_putchar.c - so you need to either remove the .c file from the build or not use the library. I suspect this is a compiler or link option setting problem and must be caused by a different Ride version to the one used to create the demo.
Regards.
RE: linker error: multiple definition of `putcharPosted by Andriy Korud on June 4, 2009 Thanks, it's exactly I supposed. The problem that I have no idea how to avoid linking libc - it's linked automatically. And worse, I want libc - there are many useful function there. And the goal is to use both - putchar from STM32F10X_IO_putchar.c and libc for the rest. Any ideas? Maybe I'm wrong somewhere?
regards, Andriy
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|