This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

converting Keil MDK-lite to OSX GNU problem.

because license is so expensive, I'm converting my project to OSX GNU

I'm solving problems step by step..

and there is error that I couldn't understand.

Anyone can help me what's wrong here?

Thanks.

/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: error: adc.o: Conflicting CPU architectures 12/0
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file adc.o
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: error: afe4403.o: Conflicting CPU architectures 12/0
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file afe4403.o
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: error: mpu6050.o: Conflicting CPU architectures 12/0
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file mpu6050.o
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: error: spi_master2.o: Conflicting CPU architectures 12/0
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file spi_master2.o
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: error: twi_hw_master_sd.o: Conflicting CPU architectures 12/0
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file twi_hw_master_sd.o
_build/Sensor.o: In function `sensorReceiveRawData':
Sensor.c:(.text.sensorReceiveRawData+0x78): undefined reference to `sqrt'
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: Dwarf Error: Could not find abbrev number 10.
afe4403.o: In function `afe_write_reg':
..\..\RedCarrot_ver2(c)\afe4403.c:(.text+0x0): undefined reference to `_printf_percent'
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
..\..\RedCarrot_ver2(c)\afe4403.c:(.text+0x0): undefined reference to `_printf_d'
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: Dwarf Error: found dwarf version '11822', this reader only handles version 2, 3 and 4 information.
..\..\RedCarrot_ver2(c)\afe4403.c:(.text+0x0): undefined reference to `_printf_int_dec'
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: Dwarf Error: found dwarf version '23598', this reader only handles version 2, 3 and 4 information.
afe4403.o: In function `heartpulse':
..\..\RedCarrot_ver2(c)\afe4403.c:(.text+0x7a2): undefined reference to `__2sprintf'
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: _build/ble_app_allb_s110_xxaa.out: hidden symbol `__2sprintf' isn't defined
/usr/local/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [_build/ble_app_allb_s110_xxaa.out] Error 1
Parents
  • Hi, to solve undefined reference to `sqrt' your need to link with the -lm option. The placement of this option is important (see gcc reference) and should be just before the -o option. As an example, see this modified MAKEFILE section:

    nrf51422_xxac_s110: $(BUILD_DIRECTORIES) $(OBJECTS) @echo Linking target: $(OUTPUT_FILENAME).out $(NO_ECHO)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -lm -o $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out

    HTH Johannes

Reply
  • Hi, to solve undefined reference to `sqrt' your need to link with the -lm option. The placement of this option is important (see gcc reference) and should be just before the -o option. As an example, see this modified MAKEFILE section:

    nrf51422_xxac_s110: $(BUILD_DIRECTORIES) $(OBJECTS) @echo Linking target: $(OUTPUT_FILENAME).out $(NO_ECHO)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -lm -o $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out

    HTH Johannes

Children
No Data
Related