abumq / easyloggingpp

C++ logging library. It is powerful, supports asynchronous low latency, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.
MIT License
3.8k stars 929 forks source link

ELPP_UNICODE cause link error #579

Open Befzz opened 7 years ago

Befzz commented 7 years ago
#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 )

DaveRabelink commented 6 years ago

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)

mage-game commented 6 years ago

You can define it in vs project

nejcgalof commented 3 years ago

I have the same problem with linking with CMake when I add macro ELPP_UNICODE. Other macros work ok for me.

tconqueror commented 2 years ago

2022 and I still get the same problem. Does anyone have a solution?

tconqueror commented 2 years ago

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