AnsweredAssumed Answered

multiple definition of '_malloc_r'

Question asked by Manuel Stühn on Sep 29, 2014
Latest reply on Sep 30, 2014 by alejandrolozano


I'm trying to build a C++ MQX 4.1.1 application on the TWR-VF65GS10_M4 (ARM-GCC 4_8-2014q1 and eclipse Luna 4.4.0). But it ends with the following error message:


gcc-arm-none-eabi-4_8-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o): In function `_malloc_r':

mallocr.c:(.text._malloc_r+0x0): multiple definition of `_malloc_r'

MQX_4_1_1_LINUX_GA/mqx/source/psp/cortex_m/compiler/gcc_arm/comp.c:94: first defined here


Having a look into the provided makefiles (the mentioned project is an eclipse-based project), i found the following option in the linker-flags:


-Xlinker -z -Xlinker muldefs


If i use this linkerflag in my eclipse-project also the project compiles and links. But i would like to not use this scary linkerflag. How can i avoid this linkerflag?