Open skywo1f opened 2 years ago
Hey! Did you end up solving this issue?
I think this is related to the avr-libstdcpp mentioned in 10.3 Use of the Arduino library.
Okay, I've managed to fix this by following the instructions in Chinese here. It requires copying and pasting the lib\avr-libstdcpp
folder included with the MyCobotBasic repository into your computer's Arduino/libraries
folder.
But now I am getting another error:
In file included from ~/Documents/Arduino/libraries/avr-libstdcpp/new_handler.cc:26:0:
~/Documents/Arduino/libraries/avr-libstdcpp/new:40:10: fatal error: stddef: No such file or directory
#include <stddef>
^~~~~~~~
compilation terminated.
exit status 1
Compilation error: exit status 1
If I edit avr-libstdcpp/new#L40 like this
- #include <stddef>
+ #include <cstddef>
then I get lots of other errors:
~/Documents/Arduino/libraries/avr-libstdcpp/new_handler.cc:30:12: error: 'std::new_handler' has not been declared
using std::new_handler;
^~~~~~~~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/new_handler.cc:33:3: error: 'new_handler' does not name a type
new_handler __new_handler;
^~~~~~~~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/new_handler.cc:36:1: error: 'new_handler' does not name a type
new_handler
^~~~~~~~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/new_handler.cc:44:1: error: 'new_handler' does not name a type
new_handler
^~~~~~~~~~~
In file included from ~/Documents/Arduino/libraries/avr-libstdcpp/cmath:45:0,
from ~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:11:
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float cos(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:17:9: error: conflicting declaration of C function 'float cos(float)'
float cosf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:127:15: note: previous declaration 'double cos(double)'
extern double cos(double __x) __ATTR_CONST__;
^~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float sin(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:22:9: error: conflicting declaration of C function 'float sin(float)'
float sinf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:133:15: note: previous declaration 'double sin(double)'
extern double sin(double __x) __ATTR_CONST__;
^~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float tan(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:27:9: error: conflicting declaration of C function 'float tan(float)'
float tanf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:139:15: note: previous declaration 'double tan(double)'
extern double tan(double __x) __ATTR_CONST__;
^~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float fabs(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:32:9: error: conflicting declaration of C function 'float fabs(float)'
float fabsf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:146:15: note: previous declaration 'double fabs(double)'
extern double fabs(double __x) __ATTR_CONST__;
^~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float fmod(float, float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:37:9: error: conflicting declaration of C function 'float fmod(float, float)'
float fmodf(float x, float y)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:153:15: note: previous declaration 'double fmod(double, double)'
extern double fmod(double __x, double __y) __ATTR_CONST__;
^~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float square(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:52:9: error: conflicting declaration of C function 'float square(float)'
float squaref(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:203:15: note: previous declaration 'double square(double)'
extern double square(double __x) __ATTR_CONST__;
^~~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float floor(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:57:9: error: conflicting declaration of C function 'float floor(float)'
float floorf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:210:15: note: previous declaration 'double floor(double)'
extern double floor(double __x) __ATTR_CONST__;
^~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float ceil(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:62:9: error: conflicting declaration of C function 'float ceil(float)'
float ceilf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:217:15: note: previous declaration 'double ceil(double)'
extern double ceil(double __x) __ATTR_CONST__;
^~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float frexp(float, int*)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:67:9: error: conflicting declaration of C function 'float frexp(float, int*)'
float frexpf(float value, int* exp)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:235:15: note: previous declaration 'double frexp(double, int*)'
extern double frexp(double __x, int *__pexp);
^~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float ldexp(float, int)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:72:9: error: conflicting declaration of C function 'float ldexp(float, int)'
float ldexpf(float x, int exp)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:243:15: note: previous declaration 'double ldexp(double, int)'
extern double ldexp(double __x, int __exp) __ATTR_CONST__;
^~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float exp(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:77:9: error: conflicting declaration of C function 'float exp(float)'
float expf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:249:15: note: previous declaration 'double exp(double)'
extern double exp(double __x) __ATTR_CONST__;
^~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float cosh(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:82:9: error: conflicting declaration of C function 'float cosh(float)'
float coshf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:255:15: note: previous declaration 'double cosh(double)'
extern double cosh(double __x) __ATTR_CONST__;
^~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float sinh(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:87:9: error: conflicting declaration of C function 'float sinh(float)'
float sinhf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:261:15: note: previous declaration 'double sinh(double)'
extern double sinh(double __x) __ATTR_CONST__;
^~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float tanh(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:92:9: error: conflicting declaration of C function 'float tanh(float)'
float tanhf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:267:15: note: previous declaration 'double tanh(double)'
extern double tanh(double __x) __ATTR_CONST__;
^~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float acos(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:97:9: error: conflicting declaration of C function 'float acos(float)'
float acosf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:275:15: note: previous declaration 'double acos(double)'
extern double acos(double __x) __ATTR_CONST__;
^~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float asin(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:102:9: error: conflicting declaration of C function 'float asin(float)'
float asinf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:283:15: note: previous declaration 'double asin(double)'
extern double asin(double __x) __ATTR_CONST__;
^~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float atan(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:107:9: error: conflicting declaration of C function 'float atan(float)'
float atanf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:290:15: note: previous declaration 'double atan(double)'
extern double atan(double __x) __ATTR_CONST__;
^~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float atan2(float, float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:112:9: error: conflicting declaration of C function 'float atan2(float, float)'
float atan2f(float y, float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:299:15: note: previous declaration 'double atan2(double, double)'
extern double atan2(double __y, double __x) __ATTR_CONST__;
^~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float log(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:117:9: error: conflicting declaration of C function 'float log(float)'
float logf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:305:15: note: previous declaration 'double log(double)'
extern double log(double __x) __ATTR_CONST__;
^~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float log10(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:122:9: error: conflicting declaration of C function 'float log10(float)'
float log10f(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:311:15: note: previous declaration 'double log10(double)'
extern double log10(double __x) __ATTR_CONST__;
^~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'float pow(float, float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:127:9: error: conflicting declaration of C function 'float pow(float, float)'
float powf(float x, float y)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:317:15: note: previous declaration 'double pow(double, double)'
extern double pow(double __x, double __y) __ATTR_CONST__;
^~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'bool isnan(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:132:8: error: conflicting declaration of C function 'bool isnan(float)'
bool isnanf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:324:12: note: previous declaration 'int isnan(double)'
extern int isnan(double __x) __ATTR_CONST__;
^~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'bool isinf(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:137:8: error: conflicting declaration of C function 'bool isinf(float)'
bool isinff(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:334:12: note: previous declaration 'int isinf(double)'
extern int isinf(double __x) __ATTR_CONST__;
^~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'bool isfinite(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:142:8: error: conflicting declaration of C function 'bool isfinite(float)'
bool isfinitef(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:341:34: note: previous declaration 'int isfinite(double)'
__ATTR_CONST__ static inline int isfinite (double __x)
^~~~~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc: In function 'int signbit(float)':
~/Documents/Arduino/libraries/avr-libstdcpp/math.cc:152:7: error: conflicting declaration of C function 'int signbit(float)'
int signbitf(float x)
^
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/math.h:377:12: note: previous declaration 'int signbit(double)'
extern int signbit (double __x) __ATTR_CONST__;
^~~~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/functional.cc:36:3: error: 'bad_function_call' does not name a type; did you mean '_Function_base'?
bad_function_call::~bad_function_call() noexcept = default;
^~~~~~~~~~~~~~~~~
_Function_base
~/Documents/Arduino/libraries/avr-libstdcpp/functional.cc:39:3: error: 'bad_function_call' has not been declared
bad_function_call::what() const noexcept
^~~~~~~~~~~~~~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/functional.cc:39:35: error: non-member function 'const char* std::what()' cannot have cv-qualifier
bad_function_call::what() const noexcept
^~~~~~~~
~/Documents/Arduino/libraries/avr-libstdcpp/hashtable_c++0x.cc: In member function 'std::size_t std::__detail::_Prime_rehash_policy::_M_next_bkt(std::size_t) const':
~/Documents/Arduino/libraries/avr-libstdcpp/hashtable_c++0x.cc:138:61: error: '(((const long unsigned int*)(& __prime_list)) + 1020)' is not a constant expression
constexpr auto __last_prime = __prime_list + __n_primes - 1;
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
exit status 1
Compilation error: exit status 1
So I am not sure if that is the correct fix...
Hello, I had exactly the same problem, to solve it, have use the IDE Arduino 1.8.19 !!! And NOT IDE Arduino 2.3.3 !!! I don't know why exactly there is this difference... but if it's can help ...
When attempting to compile any examples for the arduino, I get:
In file included from C:\Users\iviti\sketchbook\libraries\MyCobotBasic/MyCobotSaver.h:5:0, from C:\Users\iviti\sketchbook\libraries\MyCobotBasic/MyCobotBasic.h:7, from C:\Users\iviti\sketchbook\mySetRGB\mySetRGB.ino:1: C:\Users\iviti\sketchbook\libraries\MyCobotBasic/ParameterList.h:27:10: fatal error: array: No such file or directory
include
compilation terminated. exit status 1 Error compiling for board Arduino Mega or Mega 2560.