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
Describe the bug
When trying to compile the library with an external version of spdlog with a certain configuration, there is a misuse of the spdlog API which makes it not compile on Windows. The following errors occur while compiling:
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(48): error C2672: 'spdlog::basic_logger_mt': no matching overloaded function found
D:\vcpkg_installed\x64-windows-static\include\spdlog/sinks/basic_file_sink.h(44): note: could be 'std::shared_ptr<spdlog::logger> spdlog::basic_logger_mt(const std::string &,const spdlog::filename_t &,bool,const spdlog::file_event_handlers &)'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(48): note: 'initializing': cannot convert from 'const std::string' to 'const spdlog::filename_t &'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(48): note: Reason: cannot convert from 'const std::string' to 'const spdlog::filename_t'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(48): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(108): error C2672: 'spdlog::basic_logger_mt': no matching overloaded function found
D:\vcpkg_installed\x64-windows-static\include\spdlog/sinks/basic_file_sink.h(44): note: could be 'std::shared_ptr<spdlog::logger> spdlog::basic_logger_mt(const std::string &,const spdlog::filename_t &,bool,const spdlog::file_event_handlers &)'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(108): note: 'initializing': cannot convert from 'const std::string' to 'const spdlog::filename_t &'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(108): note: Reason: cannot convert from 'const std::string' to 'const spdlog::filename_t'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(108): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(109): error C3536: 'logger': cannot be used before it is initialized
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(109): error C2664: 'void LIEF::logging::Logger::set_logger(std::shared_ptr<spdlog::logger>)': cannot convert argument 1 from 'int' to 'std::shared_ptr<spdlog::logger>'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(109): note: 'std::shared_ptr<spdlog::logger>::shared_ptr': no overloaded function could convert all the argument types
include\memory(1573): note: could be 'std::shared_ptr<spdlog::logger>::shared_ptr(std::nullptr_t) noexcept'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(109): note: 'std::shared_ptr<spdlog::logger>::shared_ptr(std::nullptr_t) noexcept': cannot convert argument 1 from 'int' to 'std::nullptr_t'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(109): note: only a null pointer constant can be converted to nullptr_t
include\memory(1668): note: or 'std::shared_ptr<spdlog::logger>::shared_ptr(std::unique_ptr<_Ux,_Dx> &&)'
include\memory(1644): note: or 'std::shared_ptr<spdlog::logger>::shared_ptr(std::shared_ptr<_Ty2> &&) noexcept'
include\memory(1634): note: or 'std::shared_ptr<spdlog::logger>::shared_ptr(const std::shared_ptr<_Ty2> &) noexcept'
include\memory(1624): note: or 'std::shared_ptr<spdlog::logger>::shared_ptr(std::shared_ptr<_Ty2> &&,spdlog::logger *) noexcept'
include\memory(1618): note: or 'std::shared_ptr<spdlog::logger>::shared_ptr(const std::shared_ptr<_Ty2> &,spdlog::logger *) noexcept'
include\memory(1613): note: or 'std::shared_ptr<spdlog::logger>::shared_ptr(std::nullptr_t,_Dx,_Alloc)'
include\memory(1607): note: or 'std::shared_ptr<spdlog::logger>::shared_ptr(std::nullptr_t,_Dx)'
include\memory(1601): note: or 'std::shared_ptr<spdlog::logger>::shared_ptr(_Ux *,_Dx,_Alloc)'
include\memory(1593): note: or 'std::shared_ptr<spdlog::logger>::shared_ptr(_Ux *,_Dx)'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(109): note: while trying to match the argument list '(int)'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.hpp(120): note: see declaration of 'LIEF::logging::Logger::set_logger'
D:\lief\src\0.16.1-a11c893c52.clean\src\logging.cpp(109): note: while trying to match the argument list '(int)'
To Reproduce
Add an external version of spdlog and configure it to define SPDLOG_WCHAR_FILENAMES. This is the only way to correctly handle unicode paths on Windows. Now compile LIEF and see it fail when trying to create a logger through the spdlog::basic_logger_mt interface like here:
Describe the bug
When trying to compile the library with an external version of spdlog with a certain configuration, there is a misuse of the spdlog API which makes it not compile on Windows. The following errors occur while compiling:
To Reproduce
Add an external version of spdlog and configure it to define
SPDLOG_WCHAR_FILENAMES
. This is the only way to correctly handle unicode paths on Windows. Now compile LIEF and see it fail when trying to create a logger through thespdlog::basic_logger_mt
interface like here:LIEF/src/logging.cpp
Line 48 in d3ad812
The issue is that you pass a
std::string
to the logging interface which expects aspdlog::filename_t
.Same issue also happens in
LIEF/src/logging.cpp
Line 114 in d3ad812
Expected behavior
I expect the library to build fine on Windows even with an external spdlog using
SPDLOG_WCHAR_FILENAMES
define.Environment (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: