Not sure if this problem has been reported. I wrote a simple class,
File.h
#ifndef FS_H
#define FS_H
#undef min
#undef max
#include <memory>
class File
{
public:
File() {
_info = 0;
}
int getInfo(void);
protected:
int _info;
};
#endif
and File.cpp
#include "File.h"
int File::getInfo() {
return _info;
}
The Arduino ino file,
#include "File.h"
File f;
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
I got tons of compile errors (too many lines, I just copied some lines from Arduino console)
/home/ubuntu/.arduino15/packages/realtek/tools/ameba_d_asdk_toolchain/1.0.1/arm-none-eabi/include/c++/6.5.0/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long double)':
/home/ubuntu/.arduino15/packages/realtek/tools/ameba_d_asdk_toolchain/1.0.1/arm-none-eabi/include/c++/6.5.0/bits/basic_string.h:5538:45: error: '_rtl_vsnprintf' is not a member of 'std'
return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
^~~
from /home/ubuntu/.arduino15/packages/realtek/hardware/AmebaD/3.1.2/libraries/OOP/src/File.h:7,
from /home/ubuntu/.arduino15/packages/realtek/hardware/AmebaD/3.1.2/libraries/OOP/src/File.cpp:1:
/home/ubuntu/.arduino15/packages/realtek/hardware/AmebaD/3.1.2/system/component/soc/realtek/amebad/fwlib/include/rtl8721d_ram_libc.h:18:12: note: '_rtl_vsnprintf'
extern int _rtl_vsnprintf(char *buf, size_t size, const char *fmt, va_list ap);
^~~~~~~~~~~~~~
exit status 1
The ino file shows below compiles without any problem!!
#undef min
#undef max
#include <memory>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Environment:Ubuntu 20.04, Arduino 1.8.19. Ameba SDK 3.1.2
Two boards are installed in the Board Manager, Arduino AVR Board and AmebaD ARM (32-bits) Boards.
I have also modified Arduino.h and un-comment the 28th line so the line looks like,
#define Arduino_STD_PRINTF
Any suggestion/comment ?