我正在尝试编译以下代码:
#include <glog/logging.h>
using namespace std;
int main(int argc, char **argv)
{
google::InitGoogleLogging(argv[0]);
LOG(ERROR)<<"ERROR";
}
但是它给出了未定义的参考错误,如下:
undefined reference to `google::LogMessage::~LogMessage()'
undefined reference to `google::LogMessage::~LogMessage()'
undefined reference to `google::LogMessage::stream()'
undefined reference to `google::LogMessage::LogMessage(char const*, int, int)'
undefined reference to `google::InitGoogleLogging(char const*)'
我一直没有运气寻找这个错误,尽管我认为这是一个链接问题,如果它是如何链接的话?还是其他?