Need help in understanding this error ) SOLVED :)

Hi,
To start with i was trying to working on a code that compiled well on Arduino 1.0.5, but since i didn't had the same hardware as the owner of the code so i made some changes accordingly, but now i'm am getting an error message that i'm unable to sort out myself.

due to space constraints i have attached the code:

In file included from C:\Users\Shushant\Documents\Arduino\libraries\i2ckeypad\i2ckeypad.cpp:49:
C:\Users\Shushant\Downloads\arduino-1.0.5-windows\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:196: error: declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with
C:\Users\Shushant\Downloads\arduino-1.0.5-windows\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:195: error: previous declaration 'uint16_t makeWord(uint16_t)' here
C:\Users\Shushant\Downloads\arduino-1.0.5-windows\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:206: error: declaration of C function 'long int random(long int)' conflicts with
c:/users/shushant/downloads/arduino-1.0.5-windows/arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:504: error: previous declaration 'long int random()' here
C:\Users\Shushant\Downloads\arduino-1.0.5-windows\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:207: error: declaration of C function 'long int random(long int, long int)' conflicts with
C:\Users\Shushant\Downloads\arduino-1.0.5-windows\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:206: error: previous declaration 'long int random(long int)' here

i'm using Arduino UNO with Atmega328, Operating system: Windows 8.01

arduinosketch.doc (46.5 KB)

I think you have other library with some functions that are in conflict with the new ones.

your library file i2ckeypad.cpp is including Arduino.h when it's already been included somewhere else in your project.

Remove the include statement from i2ckeypad.cpp or find out where else you're including it and remove that reference.

KenF:
your library file i2ckeypad.cpp is including Arduino.h when it's already been included somewhere else in your project.

Remove the include statement from i2ckeypad.cpp or find out where else you're including it and remove that reference.

i guess every file in the library does have Arduino.h????

So did you remove it from i2ckeypad.cpp? and did the problem go away?

yes i did, but i'm still getting the same error.

Exactly the same? Even after you removed #include <arduino.h> from i2ckeypad.cpp? And saved changes?

Hmmm...

ok,i tried it again, but this time it worked :slight_smile: .

thank you for helping me out