Hello together,
i get some undefined reference due to my different organising structure of my libraries.
#include "Project.h"
ModulA modula;
ModulB modulb;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
modula.execute();
modulb.execute();
}
I get this errors:
C:\Users\Tobs\Documents\Arduino\ProjectTest/ProjectTest.ino:13: undefined reference to `ModulA::execute()'
C:\Users\Tobs\Documents\Arduino\ProjectTest/ProjectTest.ino:14: undefined reference to `ModulB::execute()'
sketch\ProjectTest.ino.cpp.o: In function `__static_initialization_and_destruction_0':
C:\Users\Tobs\Documents\Arduino\ProjectTest/ProjectTest.ino:3: undefined reference to `ModulA::ModulA()'
C:\Users\Tobs\Documents\Arduino\ProjectTest/ProjectTest.ino:4: undefined reference to `ModulB::ModulB()'
C:\Users\Tobs\Documents\Arduino\ProjectTest/ProjectTest.ino:4: undefined reference to `ModulA::~ModulA()'
C:\Users\Tobs\Documents\Arduino\ProjectTest/ProjectTest.ino:4: undefined reference to `ModulB::~ModulB()'
The code ist available on github where you can see the structure of the libraries.
https://github.com/huetob/ArduinoIncludeTest
#ifndef Project_h
#define Project_h
#include "Wire.h"
#include "Arduino.h"
#include "source/ModulA/ModulA.h"
#include "source/ModulB/ModulB.h"
#endif //Project_h
If I include the .cpp files, no errors appear. But I think thats the worng way to deal with this problem.
I hope that someone can help me.
Have a nice day,
Tobs