Help me out here. I don't know what I'm missing. I have this code in my arduino IDE
#include "Foo2.h"
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
And I have five files: Foo.h, Foo.cpp, Foo2.h, Foo3.cpp and Foo.h
Foo.h
#ifndef Foo_H
#define Foo_H
class Foo
{
public:
Foo();
public:
bool Fooa();
bool Foob();
};
#endif
Foo.cpp
#include "Foo.h"
Foo::Foo()
{
}
bool Foo::Foob()
{
return true;
}
Foo2.h
#ifndef Foo2_H
#define Foo2_H
#define LIBRARY_VERSION 1.0.0
#include "Foo.h"
bool Foo::Fooa()
{
return true;
}
#endif
Foo3.h
#ifndef Foo3_H
#define Foo3_H
#include "Foo2.h"
class Foo3
{
public:
Foo3();
Foo _foo;
};
#endif
Foo3.cpp
#include "Foo3.h"
Foo3::Foo3()
{
}
And it is give me an error:
libraries\Foo\Foo3.cpp.o (symbol from plugin): In function `Foo::Fooa()':
(.text+0x0): multiple definition of `Foo::Fooa()'
sketch\kk2.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
what i'm doing wrong
regards,