abumq / easyloggingpp

C++ logging library. It is extremely powerful, 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.74k stars 918 forks source link

SHARE_EASYLOGGINGPP is causing link errors #392

Open Celeborn2BeAlive opened 8 years ago

Celeborn2BeAlive commented 8 years ago

Hi, When I try using SHARE_EASYLOGGINGPP instead of the INITIALIZE_NULL_EASYLOGGINGPP + setStorage combination in the DLLSample, I obtain the following link error (compiling on VS2012):

error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits,class std::allocator > el::base::utils::s_currentUser" error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits,class std::allocator > el::base::utils::s_currentHost"

It seems related to the fact that SHARE_EASYLOGGINGPP does not call the macro ELPP_INITI_BASIC_DECLR, but I have not investigate any further.

trevex commented 8 years ago

Encountered the same issue, there was a possible fix posted here: https://github.com/easylogging/easyloggingpp/issues/386

Oipo commented 7 years ago

I had this issue when using a library I wrote(which also used easylogging) which used a different version of easylogging than the executable using my library.

So, please ensure you're using the exact same easylogging header + source for both your dll and your exe.