EEPROM error, must be missing something

I’m trying to compile the following short blurb of code in a library, but it’s giving me the following error (… for omissions):

...\EEPROM.cpp: In function 'unsigned char memByteEEPROM(const void*)':

...\EEPROM.cpp:14:51: error: 'EEPROM' was not declared in this scope

 unsigned char memByteEEPROM(const void* x){return;}

I feel like I’m missing something obvious, especially because I’m new to cpp. It worked fine when my library was one file, but now that I tried to split it into different headers and cpp files, this EEPROM error is coming up.

The relevant code in EEPROM.cpp is below:

#include <EEPROM.h>
#include <Arduino.h>

/* return EEPROM byte at address x */
unsigned char memByteEEPROM(const void* x){return;}

Relevant portions of the headers and linked headers are also below.

This is EEPROM.h

#ifndef EEPROM_h
#define EEPROM_h

#include "Dump.h"



This is Dump.h

#ifndef dump_h
#define dump_h

#include <Arduino.h>
#include <HardwareSerial.h>
#include <EEPROM.h>



I’m compiling on win10 in the arduino IDE, 1.8.5 for the Arduino Uno. Any help is appreciated! I have tried removing the “#include <EEPROM.h>” from dump.h or EEPROM.h so I don’t think double including the EEPROM has anything to do with it?

the parameter of read is an int address

uint8_t read( int idx )

why are you passing it an pointer to void?

Hmm... seems you're right on that one, I am now casting the void * to a uint8_t now. However, I'm still getting the same error as before, and compilation stops before before it even gets to the point where it would have an issue with a void * not being uint8_t. Also tried changing the parameter itself to a uint8_t, but the compiler's still hitting the EEPROM error above and exiting straight away.

when you call the function memByteEEPROM() what is the parameter type?

are you writing your own EEPROM.CPP?

Wait timeout, I think I just realized what’s happening… I’m pretty sure because I have a file header named as EEPROM.h in my library that its clashing with the library EEPROM, so the namespace is getting screwed up and hence I’m not getting access to EEPROM libraries. I will try changing the names of my files and see if it fixes the error.

I am now casting the void * to a uint8_t now.

Why? A void * is NOT a uint8_t, so the cast makes no sense.

Relevant portions of the headers and linked headers are

probably not what you think is relevant. The sticky at the top of the forum very clearly says “POST ALL OF YOUR CODE!”.

also if you have a local header file enclose the filename in “”

#include "myEEPROM.h"

filenames in <> refer to system header files
if “” are used the compiler will look in the local directories first then in the system directorys

Thanks @all for your suggestions, I changed my header file name away from "EEPROM.h" and everything worked. That was quite a silly mistake from me. I believe namespace conflicts indeed were the problem.