Compile error with Mega2560 selected

Hi,
I am using Arduino1.0. All works fine when I select any 328 board but when I try to compile for the Mega2560, I get string of errors from the core that I cant find the reason for.

This is some of them

In file included from C:\arduino-1.0\hardware\arduino\cores\arduino\/Platform.h:7,
                 from C:\arduino-1.0\hardware\arduino\cores\arduino\CDC.cpp:19:
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h: In function 'void eeprom_read_block(void*, const void*, size_t)':
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:290: error: ISO C++ forbids incrementing a pointer of type 'void*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:290: error: ISO C++ forbids incrementing a pointer of type 'const void*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:290: error: invalid conversion from 'const void*' to 'const uint8_t*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:290: error:   initializing argument 1 of 'uint8_t eeprom_read_byte(const uint8_t*)'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h: In function 'void eeprom_write_block(const void*, void*, size_t)':
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:398: error: ISO C++ forbids incrementing a pointer of type 'void*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:398: error: ISO C++ forbids incrementing a pointer of type 'const void*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:398: error: invalid conversion from 'void*' to 'uint8_t*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:398: error:   initializing argument 1 of 'void eeprom_write_byte(uint8_t*, uint8_t)'

Can you post your sketch?

mellis:
Can you post your sketch?

Why? It's an old problem with and old solution...

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1287507497/0#0

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1278172720/2#2
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1278172720/8#8

Thanks guys, the new eeprom.h solves the problem.
The thing is - I did a search on the forum but picked up no responses for this problem. Maybe the criteria was wrong :wink:

Weird, I thought I fixed this a long time ago: Google Code Archive - Long-term storage for Google Code Project Hosting.

It seems to work on my Mac. Does this happen for everyone on Windows?

#include <EEPROM.h>
void setup( void ) {}
void loop( void ) {}

Arduino Mega 2560 or Mega ADK
Arduino 1.0.1.

...not me.

mellis:
Weird, I thought I fixed this a long time ago: Google Code Archive - Long-term storage for Google Code Project Hosting.

Mellis,
It worked fine on Arduino0022. I just recently switched to Arduino1.0 as I was finishing up some projects and did not want to change midstream. The problem started with working code (from 0022) that was moved to Arduino1.0. It would seem that the Arduino1.0 core files are not all as up to date with your fixes.

Weird, it works just fine for me with Arduino 1.0.1 (on Windows with the Mega 2560 or ADK selected). I don't think it's changed since 1.0). Can you post your sketch?

It's working now. I replaced the eeprom.h file and now it is working. The sketch was a example for a TFT grapic display. Not my code.

Weird. Where was the old eeprom.h file located? Where did you get the one you replaced it with?

I found the replacement from one of the links that you provided earlier at this site:

http://www.cbxdragbike.com/arduino/new/

I dont recall where the eeprom.h file was located as I just pasted the new code when the file opened on the error. I think it was here though :

C:\arduino-1.0\hardware\tools\avr\avr\include\avr