Custom Classes - Redefinition of void error I'm getting a redefinition error from my classes, but can't see what I did wrong. 

Error: Icon.cpp:3:6: error: redefinition of 'void Icon::setIcon(byte (*)[8])'

Can any help me out on this? Thanks!

MyFile.ino

#include "MyIcon.h"

MyIcon myIcon;


MyIcon.h

#ifndef MyIcon_h
#define MyIcon_h

#include "Arduino.h"
#include "Icon.h"

class MyIcon : public Icon {
  public:
    MyIcon();
};

#endif


MyIcon.cpp

#include "MyIcon.h"

MyIcon::MyIcon() {

  byte _icon[8][8] = {
    {1, 1, 1, 1, 1, 1, 1, 1},
    {1, 1, 2, 2, 2, 2, 1, 1},
    {1, 2, 1, 1, 1, 1, 2, 1},
    {2, 1, 2, 2, 2, 2, 1, 2},
    {1, 2, 1, 1, 1, 1, 2, 1},
    {1, 1, 1, 2, 2, 1, 1, 1},
    {1, 1, 2, 1, 1, 2, 1, 1},
    {0, 0, 0, 1, 1, 0, 0, 0},
  };
  MyIcon::setIcon(_icon);


Icon.h

#ifndef Icon_h
#define Icon_h

#include "Arduino.h"

typedef struct{
  byte r;
  byte g;
  byte b;
} RGB;

class Icon {
  public:
    Icon();
    inline virtual void setIcon(byte icon[8][8]){};
    inline virtual void setIconColors(RGB colors[3]){};
};

#endif


Icon.cpp

#include "Icon.h"

void Icon::setIcon(byte icon[8][8]) {
  __icon = icon;
}


void Icon::setIconColors(RGB colors[3]) {
  __colors = colors;
}


Edited on 09/11/18

I attempted the following changes, before I realised thanks to KIIV, that I couldn't use array like that.

My idea was to be able to getIcon() and get back the byte array, which is later used to light up specific leds on a NeoMatrix panel.

I thought I would be able to build an icon "library" by extending a base class, setting the correct byte array in the class, and using it as needed (MyIcon, MyOtherIcon, etc...)

Have I completely missed the point?

Icon.h

void setIcon(byte icon[8][8]);
void setIconColors(RGB colors[3]);


Icon.cpp

#include "Icon.h"

Icon::Icon(){ }

void Icon::setIcon(byte icon[8][8]){
  memcpy(__icon, icon, sizeof(icon));
}


void Icon::setIconColors(RGB colors[3]){
  memcpy(__colors, colors, sizeof(colors));
}
You have bodies for setIcon and setIconColors in both the header file and the cpp file.  You can only have them in one or the other - choose.

Also, as an aside, the way that you are assigning icon data will go out of scope before you use it.  You create a local array variable which you then pass a pointer to to your constructor. That pointer is then saved. But then you go out of scope and the pointer is discarded, and the data will be overwritten.