MaHa63
MaHa63

Reputation: 11

undefined reference during AVR building, linker error

I'm trying to compile and link AVR based program in Atmel Studio (7). I have got the error message in linking phase.

I am doing this procedure first time with this software, because I got this software for maintenance. And I heard that this software have been succesfully built previously in "some environment". I installed the newest Atmel Studio, and picked project file, and selected correct processor. After the linking phase started, the error message appeared regarding undefined reference.

Building target: 16k.elf Invoking: AVR/GNU Linker : 5.4.0 "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -o 16k.elf DanskOFP.o adc_drv.o -Wl,-Map="16k.map" -Wl,--start-group -Wl,--end-group -Wl,--gc-sections -mmcu=atmega164p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\gcc\dev\atmega164p" C:\Projektit\V2.34\DanskOFP\Atmega164p\Makefile(118,1): error: recipe for target '16k.elf' failed DanskOFP.o: In function `CPRX':

C:\Projektit\V2.34\DanskOFP\Atmega164p\Makefile(118,1): error: recipe for target '16k.elf' failed DanskOFP.o: In function CPRX': C:\Projektit\V2.34\DanskOFP\DanskOFP.c(1507,1): error: undefined reference to__eewr_byte_m164p' C:\Projektit\V2.34\DanskOFP\DanskOFP.c(1507,1): error: undefined reference to __eewr_byte_m164p' C:\Projektit\V2.34\DanskOFP\DanskOFP.c(1507,1): error: undefined reference to__eewr_byte_m164p' C:\Projektit\V2.34\DanskOFP\DanskOFP.c(1507,1): error: undefined reference to __eewr_byte_m164p' C:\Projektit\V2.34\DanskOFP\DanskOFP.c(1507,1): error: undefined reference to__eewr_byte_m164p'

I expect that the internal definition regarding "__eewr_byte_m164p" should be found from somewhere, but I have no glue, has something changed between AVR versions, or should the definition presented some new practise ?

Upvotes: 0

Views: 1193

Answers (1)

JimmyB
JimmyB

Reputation: 12610

I guess that's a function from avr-libc, namely the target-specific function called from eeprom_write_byte(). Make sure that avr-libc in in the build/link path.

Upvotes: 0

Related Questions