我正在尝试在MacOSx上使用easyloggingpp(https://github.com/easylogging/easyloggingpp)并使用clang in clion。只是包含easyloggingc ++。h文件不起作用,我得到以下错误。
似乎缺少某些符号,但实际上,只有一个用于easyloggingpp的头文件,所以我不确定缺少什么。
Undefined symbols for architecture x86_64:
"el::base::utils::s_currentHost", referenced from:
el::base::LogFormat::updateFormatSpec() in main.cpp.o
"el::base::utils::s_currentUser", referenced from:
el::base::LogFormat::updateFormatSpec() in main.cpp.o
"el::base::elStorage", referenced from:
el::base::Writer::construct(int, char const*, ...) in main.cpp.o
el::base::MessageBuilder::operator<<(char const*) in main.cpp.o
el::base::MessageBuilder::operator<<(int) in main.cpp.o
el::base::Writer::processDispatch() in main.cpp.o
el::base::Writer::triggerDispatch() in main.cpp.o
el::base::Writer::initializeLogger(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool) in main.cpp.o
el::base::LogDispatcher::dispatch() in main.cpp.o
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
MWE:
#include "easylogging++.h"
int main()
{
LOG(INFO)<<"Message";
}