<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#000000 size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I am trying to compile simple program (appended), but getting lots of compilation error.</FONT></DIV>
<DIV><FONT face=Arial size=2>I am using Timesys Linux 2.6.13 for ppc440 evaluation board. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Command used for compilation:</FONT></DIV>
<DIV>$> gcc eeprom-client.c -o eeprom-client.o</DIV>
<DIV> </DIV>
<DIV>Could you help me to find out the reason behind getting the errors?</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>Sachin Rane</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>8< ------------------------<FONT face="Times New Roman" size=3>eeprom-client.c</FONT> -------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>#include <linux/i2c.h><BR>#include <linux/i2c-dev.h><BR><BR>int main()<BR>{</DIV>
<DIV> int file;<BR> int adapter_nr = 0; /* probably dynamically determined */<BR> char filename[20];</DIV>
<DIV> int addr = 0xA1; /* The I2C address */<BR></DIV>
<DIV> sprintf(filename,"/dev/i2c-%d",adapter_nr);<BR> if ((file = open(filename,O_RDWR)) < 0)<BR> {<BR> exit(1);<BR> }</DIV>
<DIV> </DIV>
<DIV> if (ioctl(file,I2C_SLAVE,addr) < 0)<BR> {<BR> exit(1);<BR> }</DIV>
<DIV> else<BR> {<BR> printf("\n Able to bind the adapter");<BR> }<BR> return 0;<BR>}<BR></DIV>
<DIV><FONT face=Arial size=2>8< -------------------------------------------------------------------------------------------------------------</FONT></DIV></BODY></HTML>