sony / nmos-cpp

An NMOS (Networked Media Open Specifications) Registry and Node in C++ (IS-04, IS-05)
Apache License 2.0
144 stars 80 forks source link

Compiler errors after recent commit #417

Open tljdebrouwer opened 2 weeks ago

tljdebrouwer commented 2 weeks ago

This commit: https://github.com/sony/nmos-cpp/commit/7a264e9fb2991af93b47978600be3f2a18b442f3

Seems to introduce a number of compilation errors on windows (tried both with Visual Studio 2019 and 2022 Enterprise):

Compilation errors:

D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp(363,79): message : while trying to match the argument list '(slog::detail::`anonymous-namespace'::log<slog::base_gate,20>, std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>)' [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp(386,83): error C2678: binary '<<': no operator found which takes a left-hand operand of type 'slog::detail::`anonymous-namespace'::log<slog::base_gate,20>' (or there is no acceptable conversion) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1051,24): message : could be 'slog::log_statement &slog::log_statement::operator <<(const slog::log_statement::manip_function &)' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1048,24): message : or       'slog::log_statement &slog::log_statement::operator <<(slog::log_statement &(__cdecl *)(slog::log_statement &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1045,24): message : or       'slog::log_statement &slog::log_statement::operator <<(std::ostream &(__cdecl *)(std::ostream &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1044,24): message : or       'slog::log_statement &slog::log_statement::operator <<(std::ios &(__cdecl *)(std::ios &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos/slog.h(24,33): message : or       'slog::log_statement &nmos::operator <<(slog::log_statement &,const std::pair<nmos::id,nmos::type> &)' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos/slog.h(15,27): message : or       'slog::log_statement &slog::operator <<(slog::log_statement &,const utf16string &)' [found using argument-dependent lookup] (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp(386,83): message : while trying to match the argument list '(slog::detail::`anonymous-namespace'::log<slog::base_gate,20>, std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>)' [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp(396,71): error C2678: binary '<<': no operator found which takes a left-hand operand of type 'slog::detail::`anonymous-namespace'::log<slog::base_gate,20>' (or there is no acceptable conversion) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1051,24): message : could be 'slog::log_statement &slog::log_statement::operator <<(const slog::log_statement::manip_function &)' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1048,24): message : or       'slog::log_statement &slog::log_statement::operator <<(slog::log_statement &(__cdecl *)(slog::log_statement &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1045,24): message : or       'slog::log_statement &slog::log_statement::operator <<(std::ostream &(__cdecl *)(std::ostream &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1044,24): message : or       'slog::log_statement &slog::log_statement::operator <<(std::ios &(__cdecl *)(std::ios &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos/slog.h(24,33): message : or       'slog::log_statement &nmos::operator <<(slog::log_statement &,const std::pair<nmos::id,nmos::type> &)' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos/slog.h(15,27): message : or       'slog::log_statement &slog::operator <<(slog::log_statement &,const utf16string &)' [found using argument-dependent lookup] (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp(396,71): message : while trying to match the argument list '(slog::detail::`anonymous-namespace'::log<slog::base_gate,20>, std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>)' [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp(464,83): error C2678: binary '<<': no operator found which takes a left-hand operand of type 'slog::detail::`anonymous-namespace'::log<slog::base_gate,20>' (or there is no acceptable conversion) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1051,24): message : could be 'slog::log_statement &slog::log_statement::operator <<(const slog::log_statement::manip_function &)' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1048,24): message : or       'slog::log_statement &slog::log_statement::operator <<(slog::log_statement &(__cdecl *)(slog::log_statement &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1045,24): message : or       'slog::log_statement &slog::log_statement::operator <<(std::ostream &(__cdecl *)(std::ostream &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1044,24): message : or       'slog::log_statement &slog::log_statement::operator <<(std::ios &(__cdecl *)(std::ios &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos/slog.h(24,33): message : or       'slog::log_statement &nmos::operator <<(slog::log_statement &,const std::pair<nmos::id,nmos::type> &)' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos/slog.h(15,27): message : or       'slog::log_statement &slog::operator <<(slog::log_statement &,const utf16string &)' [found using argument-dependent lookup] (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp(464,83): message : while trying to match the argument list '(slog::detail::`anonymous-namespace'::log<slog::base_gate,20>, std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>)' [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp(473,79): error C2678: binary '<<': no operator found which takes a left-hand operand of type 'slog::detail::`anonymous-namespace'::log<slog::base_gate,20>' (or there is no acceptable conversion) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1051,24): message : could be 'slog::log_statement &slog::log_statement::operator <<(const slog::log_statement::manip_function &)' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1048,24): message : or       'slog::log_statement &slog::log_statement::operator <<(slog::log_statement &(__cdecl *)(slog::log_statement &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1045,24): message : or       'slog::log_statement &slog::log_statement::operator <<(std::ostream &(__cdecl *)(std::ostream &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\slog/all_in_one.h(1044,24): message : or       'slog::log_statement &slog::log_statement::operator <<(std::ios &(__cdecl *)(std::ios &))' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos/slog.h(24,33): message : or       'slog::log_statement &nmos::operator <<(slog::log_statement &,const std::pair<nmos::id,nmos::type> &)' (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos/slog.h(15,27): message : or       'slog::log_statement &slog::operator <<(slog::log_statement &,const utf16string &)' [found using argument-dependent lookup] (compiling source file D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp) [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
D:\a\1\s\projects\src\libraries\nmos-cpp\Development\nmos\control_protocol_methods.cpp(473,79): message : while trying to match the argument list '(slog::detail::`anonymous-namespace'::log<slog::base_gate,20>, std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>)' [D:\a\1\s\projects\obj\Windows\nmos-cpp\nmos-cpp.vcxproj]
tljdebrouwer commented 2 weeks ago

Interestingly here: https://github.com/sony/nmos-cpp/actions/runs/11626837041/job/32379161069#step:22:10426 they are only compiler warnings.

lo-simon commented 1 day ago

Hi @tljdebrouwer , thank you for your report. We have created a PR #418 to fix the slog::log warning.

garethsb commented 12 hours ago

@tljdebrouwer, did you explicitly add /Za or /permissive- to your build? This would explain the error rather than the warning.

tljdebrouwer commented 10 hours ago

@garethsb not as far as I know..I'm 100% sure my build doesn't treat all warnings as errors.