2016年9月26日 星期一

Google 0.3.3 glog on Windows 10 with Visual Studio 2013

https://github.com/google/glog/archive/v0.3.3.zip

Compilation Error
When compiling gloc v0.3.3 in Visual Studio 2013, you may encounter the below errors.

Error 2 error C2039: 'min' : is not a member of 'std' j:\public\glog-0.3.3\src\logging.cc 75 1 libglog
Error 3 error C2873: 'min' : symbol cannot be used in a using-declaration j:\public\glog-0.3.3\src\logging.cc 75 1 libglog
Error 4 error C2065: 'min' : undeclared identifier j:\public\glog-0.3.3\src\logging.cc 1386 1 libglog
Error 5 error C2062: type 'int' unexpected j:\public\glog-0.3.3\src\logging.cc 1386 1 libglog
6 IntelliSense: namespace "std" has no member "min" j:\public\glog-0.3.3\src\logging.cc 75 12 libglog
7 IntelliSense: identifier "min" is undefined j:\public\glog-0.3.3\src\logging.cc 1386 24 libglog
8 IntelliSense: type name is not allowed j:\public\glog-0.3.3\src\logging.cc 1386 28 libglog


Solution:
Open file glog-0.3.3\src\logging.cc
Add #include <algorithm> so that it becomes
#include <vector>
#include <errno.h>                   // for errno
#include <sstream>
#include <algorithm>
#include "base/commandlineflags.h"        // to get the program name
#include "glog/logging.h"
#include "glog/raw_logging.h"

#include "base/googleinit.h"

Batch build all of them
























#define GOOGLE_GLOG_DLL_DECL
#include "src/windows/glog/logging.h"

沒有留言:

張貼留言

2007 to 2023 HP and Dell Servers Comparison

  HP Gen5 to Gen11  using ChatGPT HP ProLiant Gen Active Years CPU Socket Popular HP CPUs Cores Base Clock Max RAM Capacity Comparable Dell ...