compile i2 example

Andres
Hi im trying to compile the examples (who comes on the cd ) the i2c example
but i having this mistake:

/tmp/ccsaJC3B.o: In function `read_from_eeprom':
eeprog.c:(.text+0x144): undefined reference to `eeprom_read_byte'
/tmp/ccsaJC3B.o: In function `write_to_eeprom':
eeprog.c:(.text+0x2e4): undefined reference to `eeprom_write_byte'
/tmp/ccsaJC3B.o: In function `main':
eeprog.c:(.text+0x424): undefined reference to `eeprom_open'
eeprog.c:(.text+0x4d8): undefined reference to `eeprom_close'
collect2: ld returned 1 exit status

i have compile succefull other examples like hello or comtest

but with this one i dont know what im doing bad, im trying to compile it
with this command line:

arm-linux-gcc -o eeprog eeprog.c

I hope someone can giveme and hand with this.

Thanks!

davef
What #include files does eeprog.c have in it?  Are they in your project?

Can you find, for example: eeprom_read_byte anywhere?

skalsiu88
Try this:

arm-none-linux-gnueabi-gcc -Wall -O2   -c -o eeprog.o eeprog.c
arm-none-linux-gnueabi-gcc -Wall -O2   -c -o 24cXX.o 24cXX.c
arm-none-linux-gnueabi-gcc -Wall -O2 -o i2c eeprog.o 24cXX.o

Best regards,
Łukasz Skalski
www.lukasz-skalski.com

Andres
Thanks for the help, i found two ways to compile it

1. add this to eeprog.c:

#include "24cXX.c"

2. compile with this command line:

arm-linux-gcc -o eeprog eeprog.c 24cXX.c

thanks for the help!

Andres
Hi actually im reading the eeprom, but now im trying to find the way to
read another page from the eeprom, im still using the code sample, and im
reading the first 256 bytes

i hope someone can help me , thanks!

Andres
hi, i solve my problem it was very easy

("/dev/i2c/0", 0x50

for change page i only change 50 for 51 or the page that i need to read