Hi there,
I using VS Code IDE with Platform to code an Arduino Board wich works really fine.
No I create an private library for test purpose:
|–lib
| |
| |–Bar
| … |- Bar.cpp
| … |- Bar.h
|
|- platformio.ini
|–src
… |- Bar.cpp
… |- Bar.h
… |- main.c
Bar.h:
#ifndef FUNCTIONS_H_INCLUDED
#define FUNCTIONS_H_INCLUDED
/* ^^ these are the include guards */
/* Prototypes for the functions */
int Sum (int a, int b);
int Sub (int a, int b);
int Add (int a, int b);
#endif
Bar.ccp
#include "Bar.h"
int Sum (int a, int b){
return a + b;
}
int Sub (int a, int b){
return a - b;
}
int Add (int a, int b){
return a * b;
}
main.cpp
...
u8x8.println(Sub(10, 5),DEC);
u8x8.println(Add(10, 5),DEC);
...
Well, what is the problem:
Sometime, e.g. after changing some code section, the IDE reports problem like here:
And sometimes, often after changing, the IDE reports even in the main.cpp
that the function I calling e.g. u8x8.println(Sub(10, 5),DEC);
is not know.
ALTHOUGH the compiler runs through and upload to device and running of the code was / is successful.
Any Idea?
Only moving the Bar.cpp
and Bar.h
to the src
folder where the main.cpp
stay is working:
|–lib
| |
| |–Bar
| … |- Bar.cpp
| … |- Bar.h
|
|- platformio.ini
|–src
… |- Bar.cpp
… |- Bar.h
… |- main.c