Skip to content

stitching modules conflicts with googlelog (glog) because of LOG macro #6960

@jasjuang

Description

@jasjuang
System information (version)
  • OpenCV => trunk
  • Operating System / Platform => Ubuntu 14.04 LTS
  • Compiler => gcc 4.9.3
Detailed description

Using Google log (glog) along with the stitching module will cause compilation error. It's because glog defines the "LOG" macro and the stitching module also defines it at /opencv/modules/stitching/include/opencv2/stitching/detail/util.hpp. A possible resolution is append "CV_" for the "LOG" macro and make it "CV_LOG" instead in the stitching module.

Steps to reproduce
#include "glog/logging.h"
#include "opencv2/opencv.hpp"
#include "opencv2/stitching.hpp"

int main(int argc, char **argv)
{
  google::InitGoogleLogging(argv[0]);

  LOG(INFO) << "hello world";

  return 0;
}

results in compilation error. Remove

#include "opencv2/stitching.hpp"

and it compiles.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions