You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've having a compile error on ubuntu boxes while trying to compile a custom chat application.
The problem came from the logger->warn("Public address changed: {}", addrs); line inside the getDhtConfig method ( copied from dhtchat.cpp example )
/usr/include/opendht/logger.h: In instantiation of ‘void dht::log::Logger::warn(S&&, Args&& ...) const [with S = const char (&)[27]; Args = {std::vector<dht::SockAddr, std::allocator<dht::SockAddr>>&}]’:
/home/user/Development/of_v0.12.0_linux64gcc6_release_Mosaic/addons/ofxOpenDHT/src/ofxOpenDHT.cpp:167:25: required from here
/usr/include/opendht/logger.h:68:46: error: ‘format’ is not a constant expression
68 | logger(LogLevel::warning, fmt::format(format, args...));
same error on ubuntu 21.04 and 22.04
Solved wrapping the format string in fmt::runtime to disable compile-time checks
I've having a compile error on ubuntu boxes while trying to compile a custom chat application.
The problem came from the
logger->warn("Public address changed: {}", addrs);
line inside thegetDhtConfig
method ( copied from dhtchat.cpp example )same error on ubuntu 21.04 and 22.04
Solved wrapping the format string in
fmt::runtime
to disable compile-time checksin logger.h file
changed this:
to this:
Don't now if this can cause problems, but now is compiling fine.
The text was updated successfully, but these errors were encountered: