1

I have a problem with avr-gcc. I have an error recurring:

undefined reference to `__eerd_block'

This is referred to a macro

EELOAD(s) and EESAVE(s) where s is a structure of uint, structs, eccc...

The define of EELOAD(s) and EESAVE(s) are:

#define EELOAD( s ) eeprom_read_block( &s, s##_eeprom, sizeof(s) )
#define EESAVE( s ) eeprom_write_block( &s, (void*) s##_eeprom, sizeof(s) )

I would like to know what is the s##_eeprom, or how the ## is translated, it should be an address, but I can't figure out how can I modify or how to make work this.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
rusty81
  • 53
  • 3
  • 10

1 Answers1

1

## is used to glue together two tokens. So EELOAD(foo) will get substituted to eeprom_read_block(&foo, foo_eeprom, sizeof(foo)). You'll find more information about ## here here As for the macro itself, foo_eeprom should be a valid address from EEPROM space. You should have this defined somewhere for the code to compile.

Community
  • 1
  • 1
Kissiel
  • 1,925
  • 1
  • 13
  • 11
  • Thanks very much, indeed was missing an include of the various foo_eeprom addresses. Now is compiling ,with other new errors, but that's another problem. Thank you mate, i can't vote u up sorry 'cause my rating too low, but u solved my problem. – rusty81 Apr 24 '14 at 08:49