Reputation: 15069
Building in Visual Studio 2012, APR 1.4.8 APR-UTIL 1.5.2 Log4cxx 0.10
ran configure and configure-apr
then open in VS and got 111 C2252 errors (it comes from a macro):
//
// pointer and list definition macros when building DLL using VC
//
#if defined(_MSC_VER) && !defined(LOG4CXX_STATIC) && defined(LOG4CXX)
#define LOG4CXX_PTR_DEF(T) \
template class LOG4CXX_EXPORT log4cxx::helpers::ObjectPtrT<T>; \
typedef log4cxx::helpers::ObjectPtrT<T> T##Ptr
#define LOG4CXX_LIST_DEF(N, T) \
template class LOG4CXX_EXPORT std::allocator<T>; \
template class LOG4CXX_EXPORT std::vector<T>; \
typedef std::vector<T> N
Any ideas what should I do with this ?
Upvotes: 1
Views: 2631
Reputation: 4271
This error is due to a bug in VC++ which can be worked around.
For a full answer on how to compile Log4cxx in Visual Studio 2013 on a Windows OS see my full answer here: https://stackoverflow.com/a/36737721/3637582
Upvotes: 0
Reputation: 1976
Have a look at this bug report: LOGCXX-366.
A summery of the workaround:
Edit /src/main/cpp/stringhelper.cpp, add:
#include <iterator>
Edit /src/main/include/log4cxx/log4cxx.hw , delete The following lines:
template class LOG4CXX_EXPORT std::allocator<T>; \
template class LOG4CXX_EXPORT std::vector<T>; \
extern template class LOG4CXX_EXPORT std::allocator<T>; \
extern template class LOG4CXX_EXPORT std::vector<T>; \
Upvotes: 1
Reputation: 15069
Looks like deleting the 2 lines that starts with "template" solves this.
remove this:
template class LOG4CXX_EXPORT std::allocator<T>; \
template class LOG4CXX_EXPORT std::vector<T>; \
Upvotes: 2