msys2 error in ofLog
I'm porting all that is needed to run OF with ofLibs in msys2, and when I updated compiler from -std=gnu++17 to -std=gnu++20 (because of std::clamp and std::lerp) now there is a fatal error in ofLog.h
error: use of deleted function. it seems << operator is overriding string or char
template <typename T>
ofLog & operator<<(T value) {
message << value << getPadding();
return *this;
}
Any ideas of how to solve this one?
I'll let @artificiel chime in here, but it seems to be related to a stricter rule with C++ for types that have deleted operators for ostream.
Might need an explicit u8 or char overload.
Definitely utf8 issue Try something along these lines:
ofLog& operator<<(char8_t value) {
message << static_cast
ofLog& operator<<(const std::u8string& value) { message << std::string_view(reinterpret_cast<const char*>(value.data()), value.size()) << getPadding(); return *this; }
On Sat, 16 Aug 2025 at 1:47 am, Theodore Watson @.***> wrote:
ofTheo left a comment (openframeworks/openFrameworks#8464) https://github.com/openframeworks/openFrameworks/issues/8464#issuecomment-3191942645
I'll let @artificiel https://github.com/artificiel chime in here, but it seems to be related to a stricter rule with C++ for types that have deleted operators for ostream.
— Reply to this email directly, view it on GitHub https://github.com/openframeworks/openFrameworks/issues/8464#issuecomment-3191942645, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGK2HESVMY54PJC6R4F3I33NX6HTAVCNFSM6AAAAACD6TLJH6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCOJRHE2DENRUGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>
taking a better look at the logs, it seems to be related to ofSerial.cpp trying to log a WCHAR array in ofSerial.cpp line 452. I don't think echoing a serial buffer to console means a lot so it probably can be removed.
../../../libs/openFrameworks/utils/ofLog.h:515:33: error: use of deleted function 'std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const wchar_t*) [with _Traits = char_traits<char>]'
515 | message << value << getPadding();
| ~~~~~~~~^~~~~~~~