I'm starting an OpenGL engine, using SFML as context and input managers, GLSDK for the loading of OpenGL (and images and things not important now) and Boost for some other things.
I've been wondering around in the 'logging' idea, and tried Boost.Log (failed to compile an example, and the only reference to the problem is unsolved), Log4CPP (that gave errors at startup) and finally everything seemed to be fine with easylogging++, being a header-only library (horray!) that had some neat syntax IMO.
But it gives a bunch of errors when compiling:
C2664: 'el::base::utils::DateTime::gettimeofday' : cannot convert parameter 1 from 'int *' to 'el::base::utils::timeval *'
C2228: left of '.tv_usec' must have class/struct/union
I have implemented it this way:
'helpers.Log.cpp': '_INITIALIZE_EASYLOGGINGPP' and implements init() as it follows:
el::Configurations conf("../log_config.cfg");
el::Loggers::reconfigureLogger("default", conf);
el::Loggers::reconfigureAllLoggers(conf);
Now, just those two files deal with logging. 'engine.Core.hpp' includes 'helpers.Log.hpp', 'engine.Boot.hpp' (blank by now), 'glload/gl_load.hpp', 'glload/gl_3_3.hpp' and in the constructor of the Core class, inside the engine namespace, the init() function is called.
Nothing else is done in the entire application. Just that, the initialization of the logging system, but it fails completely.
SYSTEM INFORMATION
OS: Windows 7 x64
IDE: Visual Studio 2012
COMPILER: VS2012 (v110)
COMPILE COMMAND: cl /c /IF:/BTSync/prog_projs/KINGDOMS/trunk/inc /IF:/dev/SFML/21/include /IF:/dev/GLSDK/052/glload/include /IF:/dev/GLSDK/052/glutil/include /IF:/dev/GLSDK/052/glm /IF:/dev/GLSDK/052/glmesh/include /IF:/dev/GLSDK/052/glimage/include /IF:/dev/BOOST/154 /IF:/DEV/LIBROCKET/121_3/include /Zi /nologo- /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"KINGDOMS_0_1.dir\Debug\" /Fd"F:/BTSync/prog_projs/KINGDOMS/trunk/pro/Debug/KINGDOMS_0_1_d.pdb" /Gd /TP /analyze- /errorReport:prompt ..\src\engine.Boot.cpp ..\src\engine.Core.cpp ..\src\engine.Interfaces.cpp ..\src\helpers.Log.cpp ..\src\main.cpp
EDIT BEFORE PUBLICATION: Okay, so it looks like 'glload/gl_3_3.hpp' is the problem here. It manages to break easylogging++. That is over me. How is that even possible? What can i do?
EDIT TO ADD REAL CODE
engine.Core.hpp
#pragma once
#include <glload/gl_load.hpp>
#include <glload/gl_4_4.hpp>
#include <helpers.Log.hpp>
namespace engine
{
class Core
{
public:
Core();
~Core();
};
}
engine.Core.cpp
#include <engine.Core.hpp>
engine::Core::Core()
{
helpers::log::init();
}
engine::Core::~Core()
{
}
helpers.Log.hpp
#pragma once
#include <easylogging++.h>
namespace helpers
{
namespace log
{
void init();
}
}
helpers.Log.cpp
#include <helpers.Log.hpp>
_INITIALIZE_EASYLOGGINGPP
void helpers::log::init()
{
el::Configurations conf("../log_config.cfg");
el::Loggers::reconfigureLogger("default", conf);
el::Loggers::reconfigureAllLoggers(conf);
}
I fixed it by adding
#include <Winsock2.h>
just after:
#elif _ELPP_OS_WINDOWS
# include <direct.h>
# include <Windows.h>
in easylogging++.h
It contains a definition of timeval struct. It looks like they forgot about it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With