The build is broken for both vs2010 and vs2015 with two different error scenarios.
for vs2010:
The preprocessor symbol LOG4CPLUS_HAVE_CXX11_SUPPORT
gets defined, which causes msvc to attempt to compile c++11 formatted code, a format the vs2010 compiler does not support. This is probably due to my machine also having vs2015 installes, which causes problems for the guarding #if defined
.
on my machine _MSC_VER
is defined and the version is 1900 which is above the requested 1600.
for vs2015 (Officially unsupported by which supports c++11 syntax)
The compilation fails due to an undefined FreeAddrInfoA
and FreeAddrInfoW
.
I can reproduce the issue with VS 2015 and
FreeAddrInfoA
. This is now fixed locally and I will eventually push it into master. See https://github.com/wilx/log4cplus/commit/9ab7c6404527a71ec1cc67fc42c19d913fa25b27.Regarding the other issue with VS 2010, could you please provide more information? I do not actually have access to Visual Studio 2010 any more. Where is the offending code? What error messages does it produce?
Diff:
I looked a little further into the build issue I have on vs2010. I found this information on stackoverflow.
I tried changing the guard
_MSC_VER >= 1600
in line 101 in config.hxx to_MSCVER >= 1700
.improved things a lot. Now vs2010 behaves the same way as vs2015.I'm pretty certain - though not 100% - that my old vs 2010 does not support any c++11 things. So requireing the version to be 1700 or above seems to be correct.
I forgot the actual error messages produced. There is a cascade, starting from a failed build of log4cplus and log4cplusS
log4cplus-1.2.0-rc5\include\log4cplus/internal/socket.h(176): error C2059: syntax error : ';'
seems to be the root of the cascade.
additionally I get errors from compiling Qt4DebugAppender and Qt5DebugAppender ( I don't have Qt installed, and those errors doesn't worry me because they are contained to external appenders)
If we're being really nitty gritty, I get two warnings:
..\src\fileappender.cxx(1310): warning C4244: 'initializing' : conversion from 'time_t' to 'int', possible loss of data
and
log4cplus-1.2.0-rc5\simpleserver\loggingserver.cxx(166): warning C4355: 'this' : used in base member initializer list
Thanks for the error message. The cause is most likely the
= delete
syntax. I have removed that in https://github.com/log4cplus/log4cplus/commit/82c7b791f91bb5b0c42f4bd186fa895f5dc3af53 and merged it into main repository together with the other change. Please test that.Yes :-)
All four build configurations (Debug, Debug_Unicode, Release and Release_Uncoded) build on my machine using VS2010.
Thanks
ps. Of course I still get errors for the two Qt projects, but any decent developer should have no issues figuring out the why and what of that.
The Qt failures are OK, unless you actually modify the projects and have Qt SDK.