I want to use the library without C++11 but it won't compile for me: (Theoretically it should as per documentation @http://easylogging.muflihun.com: "For lower version of C++ (non-C++11), please consider using Easylogging++ v8.91. ")
error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
File structure:
./Main.cpp ./logger/easylogging++.h
Contents of Main.cpp:
#include "logger/easylogging++.h"
_INITIALIZE_EASYLOGGINGPP
using namespace std;
int main(int argc, char* argv[]) {
LINFO << "This is my first log";
return 0;
}
../src/logger/easylogging++.h: In function ‘std::string easyloggingpp::internal::threading::getCurrentThreadId()’: ../src/logger/easylogging++.h:691:16: error: ‘std::this_thread’ has not been declared ss << std::this_thread::get_id();
Compiler: gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1), OS: Ubuntu 14.04 LTS
As T.C. suggested in the solution is to change this section of code at the top of easylogging++.h:
Changing both
_ELPP_CXX0X
and_ELPP_CXX11
to 0 will fix the issue.