0

我正在尝试在 MacOSx 上使用 easyloggingpp ( https://github.com/easylogging/easyloggingpp ) 和 clion 中的 clang。仅包含 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";
}
4

0 回答 0