-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Hello, I'm trying to get your LED animation code to run on an ESP32 and it is throwing these compile time errors:
/Users/klord/Desktop/Arduino/ANIMartRIX/noise.ino:26:37: error: 'float lerp(float, float, float)' conflicts with a previous declaration
26 | float lerp(float t, float a, float b){ return a + t * (b - a); }
| ^
In file included from /Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/math.h:36,
from /Users/klord/Library/Arduino15/packages/esp32/hardware/esp32/3.0.7/cores/esp32/esp32-hal.h:30,
from /Users/klord/Library/Arduino15/packages/esp32/hardware/esp32/3.0.7/cores/esp32/Arduino.h:36,
from /private/var/folders/30/7r5xxxjj07xcrm3sb5gmt0th0000gn/T/arduino/sketches/8C0EDF3538BAAE31F232DB0AD2124341/sketch/ANIMartRIX.ino.cpp:1:
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1911:3: note: previous declaration 'constexpr float std::lerp(float, float, float)'
1911 | lerp(float __a, float __b, float __t) noexcept
| ^~~~
/Users/klord/Desktop/Arduino/ANIMartRIX/noise.ino: In function 'float pnoise(float, float, float)':
/Users/klord/Desktop/Arduino/ANIMartRIX/noise.ino:55:26: error: call of overloaded 'lerp(float&, float, float)' is ambiguous
55 | return lerp(w,lerp(v,lerp(u, grad(P(AA ), x, y, z), /* AND ADD */
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 | grad(P(BA ), x-1, y, z)), /* BLENDED */
| ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1919:3: note: candidate: 'constexpr long double std::lerp(long double, long double, long double)'
1919 | lerp(long double __a, long double __b, long double __t) noexcept
| ^~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1915:3: note: candidate: 'constexpr double std::lerp(double, double, double)'
1915 | lerp(double __a, double __b, double __t) noexcept
| ^~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1911:3: note: candidate: 'constexpr float std::lerp(float, float, float)'
1911 | lerp(float __a, float __b, float __t) noexcept
| ^~~~
/Users/klord/Desktop/Arduino/ANIMartRIX/noise.ino:26:7: note: candidate: 'float lerp(float, float, float)'
26 | float lerp(float t, float a, float b){ return a + t * (b - a); }
| ^~~~
/Users/klord/Desktop/Arduino/ANIMartRIX/noise.ino:57:19: error: call of overloaded 'lerp(float&, float, float)' is ambiguous
57 | lerp(u, grad(P(AB ), x, y-1, z), /* RESULTS */
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 | grad(P(BB ), x-1, y-1, z))), /* FROM 8 */
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1919:3: note: candidate: 'constexpr long double std::lerp(long double, long double, long double)'
1919 | lerp(long double __a, long double __b, long double __t) noexcept
| ^~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1915:3: note: candidate: 'constexpr double std::lerp(double, double, double)'
1915 | lerp(double __a, double __b, double __t) noexcept
| ^~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1911:3: note: candidate: 'constexpr float std::lerp(float, float, float)'
1911 | lerp(float __a, float __b, float __t) noexcept
| ^~~~
/Users/klord/Desktop/Arduino/ANIMartRIX/noise.ino:26:7: note: candidate: 'float lerp(float, float, float)'
26 | float lerp(float t, float a, float b){ return a + t * (b - a); }
| ^~~~
/Users/klord/Desktop/Arduino/ANIMartRIX/noise.ino:59:25: error: call of overloaded 'lerp(float&, float, float)' is ambiguous
59 | lerp(v, lerp(u, grad(P(AA+1), x, y, z-1), /* CORNERS */
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60 | grad(P(BA+1), x-1, y, z-1)), /* OF CUBE */
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1919:3: note: candidate: 'constexpr long double std::lerp(long double, long double, long double)'
1919 | lerp(long double __a, long double __b, long double __t) noexcept
| ^~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1915:3: note: candidate: 'constexpr double std::lerp(double, double, double)'
1915 | lerp(double __a, double __b, double __t) noexcept
| ^~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1911:3: note: candidate: 'constexpr float std::lerp(float, float, float)'
1911 | lerp(float __a, float __b, float __t) noexcept
| ^~~~
/Users/klord/Desktop/Arduino/ANIMartRIX/noise.ino:26:7: note: candidate: 'float lerp(float, float, float)'
26 | float lerp(float t, float a, float b){ return a + t * (b - a); }
| ^~~~
/Users/klord/Desktop/Arduino/ANIMartRIX/noise.ino:61:19: error: call of overloaded 'lerp(float&, float, float)' is ambiguous
61 | lerp(u, grad(P(AB+1), x, y-1, z-1),
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62 | grad(P(BB+1), x-1, y-1, z-1))));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1919:3: note: candidate: 'constexpr long double std::lerp(long double, long double, long double)'
1919 | lerp(long double __a, long double __b, long double __t) noexcept
| ^~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1915:3: note: candidate: 'constexpr double std::lerp(double, double, double)'
1915 | lerp(double __a, double __b, double __t) noexcept
| ^~~~
/Users/klord/Library/Arduino15/packages/esp32/tools/esp-x32/2302/xtensa-esp32-elf/include/c++/12.2.0/cmath:1911:3: note: candidate: 'constexpr float std::lerp(float, float, float)'
1911 | lerp(float __a, float __b, float __t) noexcept
| ^~~~
/Users/klord/Desktop/Arduino/ANIMartRIX/noise.ino:26:7: note: candidate: 'float lerp(float, float, float)'
26 | float lerp(float t, float a, float b){ return a + t * (b - a); }
| ^~~~
exit status 1
Compilation error: 'float lerp(float, float, float)' conflicts with a previous declaration
It compiles fine on an RP2040, so ESP32 math lib must be different somehow.
Can you take a look please?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels