Disclaimer: I haven't done C/C++ in ages and have decided to dive into the deeper end here.
I'm attempting to build esp32-opencv which is basically a version of OpenCV with some necessary changes for the ESP32.
I'm seeing the following error on make
that isn't referenced in that project:
esp32-opencv/modules/core/src/softfloat.cpp:3537:107: error: call of overloaded 'softdouble(int)' is ambiguous
3537 | static const float64_t exp_prescale = float64_t::fromRaw(0x3ff71547652b82fe) * float64_t(1 << EXPTAB_SCALE);
| ^
In file included from esp32-opencv/modules/core/src/softfloat.cpp:68:
esp32-opencv/modules/core/include/opencv2/core/softfloat.hpp:257:14: note: candidate: 'cv::softdouble::softdouble(double)'
257 | explicit softdouble( const double a ) { Cv64suf s; s.f = a; v = s.u; }
| ^~~~~~~~~~
esp32-opencv/modules/core/src/softfloat.cpp:248:1: note: candidate: 'cv::softdouble::softdouble(int64_t)'
248 | softdouble::softdouble( const int64_t a ) { *this = i64_to_f64(a); }
| ^~~~~~~~~~
esp32-opencv/modules/core/src/softfloat.cpp:247:1: note: candidate: 'cv::softdouble::softdouble(int32_t)'
247 | softdouble::softdouble( const int32_t a ) { *this = i32_to_f64(a); }
| ^~~~~~~~~~
esp32-opencv/modules/core/src/softfloat.cpp:246:1: note: candidate: 'cv::softdouble::softdouble(uint64_t)'
246 | softdouble::softdouble( const uint64_t a ) { *this = ui64_to_f64(a); }
| ^~~~~~~~~~
esp32-opencv/modules/core/src/softfloat.cpp:245:1: note: candidate: 'cv::softdouble::softdouble(uint32_t)'
245 | softdouble::softdouble( const uint32_t a ) { *this = ui32_to_f64(a); }
| ^~~~~~~~~~
In file included from esp32-opencv/modules/core/src/softfloat.cpp:68:
esp32-opencv/modules/core/include/opencv2/core/softfloat.hpp:232:5: note: candidate: 'cv::softdouble::softdouble(const cv::softdouble&)'
232 | softdouble( const softdouble& c) { v = c.v; }
| ^~~~~~~~~~
Further up in the code it has: #define EXPTAB_SCALE 6
so the complaint seems to be about float64_t(1 << EXPTAB_SCALE)
= float64_t(1 << 6)
= float64_t(64)
?
The definitions all refer to [u]int[size]_t
and none for int
. I am building this with the xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++
compiler. The esp32-opencv project shows that it used xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++
(the difference being esp-2022r1-11.2.0
vs esp-2019r2-8.2.0
).
I don't have the knowledge to formulate a good guess on why this isn't working with the ESP32 build setup vs compiling it for my 64bit Ubuntu machine. Why would the call not be ambiguous in the latter case, but with the ESP32 build it can't decide which method to use?
If I did have to guess I would think there is some difference in how integer types are being handled in the xtensa-esp32-elf/esp-2019r2-8.2.0
compiler used in the Github project vs the xtensa-esp32-elf/esp-2022r1-11.2.0
, but I also have no idea how to check that.