<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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I am trying to compile&nbsp;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.&nbsp;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Command used for compilation:</FONT></DIV>
<DIV>$&gt;&nbsp;gcc eeprom-client.c -o eeprom-client.o</DIV>
<DIV>&nbsp;</DIV>
<DIV>Could you help me to find out the reason behind getting the errors?</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>8&lt; ------------------------<FONT face="Times New Roman" size=3>eeprom-client.c</FONT> -------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>#include &lt;linux/i2c.h&gt;<BR>#include &lt;linux/i2c-dev.h&gt;<BR><BR>int main()<BR>{</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; int file;<BR>&nbsp;&nbsp;&nbsp;&nbsp; int adapter_nr = 0; /* probably dynamically determined */<BR>&nbsp; &nbsp;&nbsp; char filename[20];</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;int addr = 0xA1; /* The I2C address */<BR></DIV>
<DIV>&nbsp;&nbsp;&nbsp; sprintf(filename,"/dev/i2c-%d",adapter_nr);<BR>&nbsp; &nbsp; if ((file = open(filename,O_RDWR)) &lt; 0)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(1);<BR>&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp; </DIV>
<DIV>&nbsp;&nbsp;&nbsp; if (ioctl(file,I2C_SLAVE,addr) &lt; 0)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(1);<BR>&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp; else<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;printf("\n Able to bind the adapter");<BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp; return 0;<BR>}<BR></DIV>
<DIV><FONT face=Arial size=2>8&lt; -------------------------------------------------------------------------------------------------------------</FONT></DIV></BODY></HTML>