c++ - glog on visual studio 2015 -
i trying build google glog library on windows using visual studio 2015. after adding #include around std::min problem on windows, 2 main errors (1 repeats few times) below.
1>c:\glog\glog-0.3.3\src\windows\port.h(117): warning c4005: 'va_copy': macro redefinition 1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\stdarg.h(20): note: see previous definition of 'va_copy' 1>c:\glog\glog-0.3.3\src\windows\port.cc(58): error c2084: function 'int snprintf(char *const ,const size_t,const char *const ,...)' has body 1> c:\program files (x86)\windows kits\10\include\10.0.10150.0\ucrt\stdio.h(1932): note: see previous definition of 'snprintf' 1> vlog_is_on.cc 1>c:\glog\glog-0.3.3\src\windows\port.h(117): warning c4005: 'va_copy': macro redefinition 1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\stdarg.h(20): note: see previous definition of 'va_copy' 1>c:\glog\glog-0.3.3\src\windows\glog\logging.h(1266): error c2280: 'std::basic_ios<char,std::char_traits<char>>::basic_ios(const std::basic_ios<char,std::char_traits<char>> &)': attempting reference deleted function 1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\ios(189): note: see declaration of 'std::basic_ios<char,std::char_traits<char>>::basic_ios' 1> c:\glog\glog-0.3.3\src\windows\glog\logging.h(1266): note: diagnostic occurred in compiler generated function 'google::logmessage::logstream::logstream(google::logmessage::logstream &&)' 1> utilities.cc
seems issue compiler generated move function, explicitly deleting not work either.
logmessage(const logmessage&&) = delete;
any ideas?
cheers, mike
the generated function not logmessage(const logmessage&&) = delete;
is:
logstream::logstream(google::logmessage::logstream &&).
internaly try call copy constructor of logstream , hence ostream marked deleted.
solution:
declare inside logstream class:
logstream(const logstream&) = delete;
logstream& operator=(const logstream&) = delete;;
cheers
Comments
Post a Comment