I tried to build google mock on Windows 7 by using MinGW. But I couldn't.
I downloaded google test and google mock from the web site below by clicking 'Download Zip' button.
[https://github.com/google/googletest][1]
I unzipped the file and execute the command on the command line.
> g++ -c -Iinclude -I. src/gmock-all.cc
But the error occurred.
> include/gmock/internal/gmock-port.h:53:45: fatal error: gtest/internal/gtest-linked_ptr.h: No such file or directory
How can I solve it?
Answer
You should first build googletest, and then googlemock. It comes bundled
with googlemock in subdirectory named "gtest". This is what you need to do:
g++ -isystem /include -I \
-isystem /include -I \
-pthread -c /src/gtest-all.cc
g++ -isystem /include -I \
-isystem /include -I \
-pthread -c /src/gmock-all.cc
This will definately work on Linux, but I cant be 100% sure for MinGW on
Win7. If it does not help, I suggest using Visual Studio Community Edition.
You already have a VS solution setup in
. It
is a solution for VS2010 but opening it with a newer version will prompt you
to upgrade the toolset. Simply accept and build the "gmock" project in that
solution.o_gmock>/src/gmock-all.cc
No comments:
Post a Comment