Following your comment I stripped 'myDB' initialization code from DBabstraction header, only leaving the pointer variable declaration. The initialization now takes place in the DBabstraction's constructor source:
// Library header
#include "DBabstraction.h"
//constructor
DBabstraction::DBabstraction(){
pInstance = this;
myDB = new EDB(DBabstraction::dbWriter, DBabstraction::dbReader); //
}
//public functions
void DBabstraction::dbWriter(unsigned long address, byte data ){
/* nothing */
}
byte DBabstraction::dbReader( unsigned long address){
/* nothing */
}
//public functions
void DBabstraction::begin(){
/* nothing */
}
// Code DBabstraction.cpp
Then I removed the struct from DBabstraction header, and created a new file called DBrecord.h:
#ifndef DBabstraction_h
#define DBabstraction_h
#include "Arduino.h"
#include <EDB.h>
//Use SPIFFS FS as data storage
#include "LStorage.h"
#include "LFlash.h"
#define Drv LFlash // use Internal 10M Flash
#define TABLE_SIZE 8192
#define FILE_PATH "tdb.txt"
// The number of demo records that should be created. This should be less
// than (TABLE_SIZE - sizeof(EDB_Header)) / sizeof(LogEvent). If it is higher,
// operations will return EDB_OUT_OF_RANGE for all records outside the usable range.
#define RECORDS_TO_CREATE 10
//
class DBabstraction {
public:
DBabstraction();
EDB *myDB;
void begin();
static LFile myFile;
static void dbWriter( unsigned long address, byte data );
static byte dbReader( unsigned long address );
private:
static DBabstraction * pInstance;
};
#endif // DBabstraction_h
DBrecord.h file:
#ifndef DBrecord_h
#define DBrecord_h
// Arbitrary record definition for this table.
// This should be modified to reflect your record needs.
struct Data_Struct {
int id;
int temperature;
}
data_struct;
#endif // DBrecord_h
Now it does compile but with theses warnings:
"/Users/Thibault/Library/Arduino15/packages/LinkIt/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -O2 -MMD -ffunction-sections -fdata-sections -fvisibility=hidden -fpic -mthumb -mlittle-endian -nostdlib -fno-non-call-exceptions -fno-rtti -fno-exceptions -Dprintf=iprintf "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk/include" -mcpu=arm7tdmi-s -DF_CPU=84000000L -DARDUINO=10805 -DARDUINO_MTK_ONE -DARDUINO_ARCH_ARM -D__COMPILER_GCC__ -D__LINKIT_ONE__ -D__LINKIT_ONE_RELEASE__ -mthumb -DUSB_VID=0x0E8D -DUSB_PID=0x0023 -DUSBCON '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="LinkIt ONE"' "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk/include" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/cores/arduino" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/variants/linkit_one" "-I/Users/Thibault/Documents/Arduino/libraries/EDB" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/libraries/LStorage" "/var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/CPPTEST.ino.cpp" -o "/var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/CPPTEST.ino.cpp.o"
In file included from /Users/Thibault/Desktop/CPPtest/CPPTEST.ino:3:0:
/Users/Thibault/Documents/Arduino/libraries/EDB/EDB.h:24:25: warning: 'typedef' was ignored in this declaration [enabled by default]
};
^
"/Users/Thibault/Library/Arduino15/packages/LinkIt/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -O2 -MMD -ffunction-sections -fdata-sections -fvisibility=hidden -fpic -mthumb -mlittle-endian -nostdlib -fno-non-call-exceptions -fno-rtti -fno-exceptions -Dprintf=iprintf "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk/include" -mcpu=arm7tdmi-s -DF_CPU=84000000L -DARDUINO=10805 -DARDUINO_MTK_ONE -DARDUINO_ARCH_ARM -D__COMPILER_GCC__ -D__LINKIT_ONE__ -D__LINKIT_ONE_RELEASE__ -mthumb -DUSB_VID=0x0E8D -DUSB_PID=0x0023 -DUSBCON '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="LinkIt ONE"' "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk/include" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/cores/arduino" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/variants/linkit_one" "-I/Users/Thibault/Documents/Arduino/libraries/EDB" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/libraries/LStorage" "/var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/DBabstraction.cpp" -o "/var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/DBabstraction.cpp.o"
In file included from /var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/DBabstraction.h:5:0,
from /var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/DBabstraction.cpp:2:
/Users/Thibault/Documents/Arduino/libraries/EDB/EDB.h:24:25: warning: 'typedef' was ignored in this declaration [enabled by default]
};
^
"/Users/Thibault/Library/Arduino15/packages/LinkIt/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -O2 -MMD -ffunction-sections -fdata-sections -fvisibility=hidden -fpic -mthumb -mlittle-endian -nostdlib -fno-non-call-exceptions -fno-rtti -fno-exceptions -Dprintf=iprintf "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk/include" -mcpu=arm7tdmi-s -DF_CPU=84000000L -DARDUINO=10805 -DARDUINO_MTK_ONE -DARDUINO_ARCH_ARM -D__COMPILER_GCC__ -D__LINKIT_ONE__ -D__LINKIT_ONE_RELEASE__ -mthumb -DUSB_VID=0x0E8D -DUSB_PID=0x0023 -DUSBCON '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="LinkIt ONE"' "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/system/libmtk/include" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/cores/arduino" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/variants/linkit_one" "-I/Users/Thibault/Documents/Arduino/libraries/EDB" "-I/Users/Thibault/Library/Arduino15/packages/LinkIt/hardware/arm/1.1.23/libraries/LStorage" "/var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/Runner.cpp" -o "/var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/Runner.cpp.o"
In file included from /var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/DBabstraction.h:5:0,
from /var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/Runner.h:5,
from /var/folders/y8/2cf22w216j7cxt1k7g54v1y80000gp/T/arduino_build_563584/sketch/Runner.cpp:2:
/Users/Thibault/Documents/Arduino/libraries/EDB/EDB.h:24:25: warning: 'typedef' was ignored in this declaration [enabled by default]
};
^
DBabstraction.cpp.o: In function `DBabstraction::DBabstraction()': DBabstraction.cpp:6: warning: undefined reference to `DBabstraction::pInstance'
Runner.cpp.o: In function `Runner::Runner()':Runner.cpp:12: warning: undefined reference to `Runner::globalDB'
pInstance and globalDB seems to not exist.
thanks again PaulS.