I encounter the following errors during the build caffe lib process:#error: <glog/logging.h> was not included correctly. Cannot open include file: 'gtest/gtest.h': No such file or directory.

Omar mohamed mostafa 0 Reputation points
2025-01-22T02:12:05.65+00:00

I encounter the following errors during the build caffe lib process:#error: <glog/logging.h> was not included correctly. Cannot open include file: 'gtest/gtest.h': No such file or directory.

I am trying to build the Caffe library using Microsoft Visual Studio 2017 as part of a project to set up OpenPose. However, I encounter the following errors during the build process:

#error: <glog/logging.h> was not included correctly.

Cannot open include file: 'gtest/gtest.h': No such file or directory.

I believe the issue is related to incorrect paths for include files and libraries for GLog, GFlags, or other dependencies."

✅ What I’ve Done So Far

I configured and generated the Caffe solution using CMake.

The GLog and GFlags libraries are already built and installed. Their paths are as follows:

Include Path for GLog: D:/glog-master/install/include

Library Path for GLog (Static): D:/glog-master/install/lib/glog_static.lib

Include Path for GFlags: D:/gflags-master/build/include

Library Path for GFlags (Static): D:/gflags-master/build/lib/Release/gflags_static.lib

I also set these paths in the CMake GUI under Caffe.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,442 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.