installation of Glog under window environmentCategory: C + +2014-09-23 14:12 32 people read reviews (0) favorite reports
Unzip after download and open Google-glog.sln with Visual Studio. Build the solution
Installation:
Method One: Libglog.dll and libglog.lib files, copy files to your project folder, and copy the Glog directory under Src\windows\ to your project file.
Method Two: You can also copy these two files to the System folder for global access.
1. Copy Libglog.dll to C:\Program Files\Microsoft Visual Studio 11.0\vc\bin
2. Copy Libglog.lib to C:\Program Files\Microsoft Visual Studio 11.0\vc\lib
3. Copy the Glog directory under Src\windows\ to C:\Program Files\Microsoft Visual Studio 11.0\vc\include
Test using:
-
#include "glog/logging.h"
#include <iostream>
#include <vector >
using namespace std;
#pragma comment (lib, "Libglog.lib")
int main (int argc, char* argv[])
{
//Initialize Google ' s logging Library.
Google::initgooglelogging (argv[0]);
Google::setlogdestination (Google::info, "e://");
//Set log path INFO WARNING ERROR FATAL
//...
Char str[20] = "Hello log!";
LOG (INFO) << "Found" << google::counter << Endl;
LOG (INFO) << str;//<< "cookies";
Log (WARNING) << "WARNING test";//output a WARNING log
log (Error) << "error test";//output an error log
System ("pause");
return 0;
}
This article originates from: http://blog.csdn.net/lijingpengchina/article/details/9047777///////////////////////////////////////////// Description: 1: Build Solution is not debug, but build = "Build solution (or shortcut key F7) 2: Will be reborn into a directory debug, All Libglog.dll and Libglog.lib are located in the Debug Directory 3: The second method is recommended
Installation of Glog under window environment