easyloggingpp
easyloggingpp copied to clipboard
ELPP_UNICODE cause link error
#define ELPP_UNICODE
#include "deps/easyloggingpp/easylogging++.h"
INITIALIZE_EASYLOGGINGPP
Version 9.95.3 - Link error (1 unresolved externals)
Version 9.95.3 without #define ELPP_UNICODE
- OK
unresolved external symbol
"public: virtual class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t>
> __thiscall el::base::DefaultLogBuilder::build(class el::LogMessage const *,bool)const "
(?build@DefaultLogBuilder@base@el@@UBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PBVLogMessage@3@_N@Z)
Version 9.89 - OK
What i'am doing wrong? 😄
Windows x64_x86
Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25547 for x86 (MSBuildTools for VS2017)
( /EHsc /std:c++14 /MT )
I have the same issue. Version 9.95.3 - Link error (1 unresolved externals)
error LNK2001: unresolved external symbol "public: virtual class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __thiscall el::base::DefaultLogBuilder::build(class el::LogMessage const *,bool)const " (?build@DefaultLogBuilder@base@el@@UBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PBVLogMessage@3@_N@Z)
You can define it in vs project
I have the same problem with linking with CMake when I add macro ELPP_UNICODE
. Other macros work ok for me.
2022 and I still get the same problem. Does anyone have a solution?
This solution work for me: https://blog.csdn.net/m0_38101947/article/details/103476450?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_utm_term~default-1.pc_relevant_antiscanv2&spm=1001.2101.3001.4242.2&utm_relevant_index=4