Installation of Glog under window environment

Source: Internet
Author: User

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:

    1. #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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.