easyloggingpp icon indicating copy to clipboard operation
easyloggingpp copied to clipboard

ELPP_UNICODE cause link error

Open Befzz opened this issue 6 years ago • 5 comments

#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 )

Befzz avatar Oct 20 '17 16:10 Befzz

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)

DaveRabelink avatar Nov 15 '17 09:11 DaveRabelink

You can define it in vs project

mage-game avatar Dec 15 '17 14:12 mage-game

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

nejcgalof avatar Jul 19 '21 09:07 nejcgalof

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

tconqueror avatar Apr 12 '22 04:04 tconqueror

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

tconqueror avatar Apr 13 '22 03:04 tconqueror