How to Configure GoogleMock in Visual Studio 2017 After Already Installing GoogleTest?

前端 未结 3 1135
不思量自难忘°
不思量自难忘° 2021-01-18 00:05

I installed the Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn package into my VS 2017 application solution. This was accomplished by adding a new GoogleTest pr

3条回答
  •  星月不相逢
    2021-01-18 00:32

    TLDR; The solution for me was renaming the include folder provided with Google Mock package

    from:

    packages\googlemock.v140.windesktop.static.rt-dyn.1.7.0.1\build\native\include\gtest

    to

    packages\googlemock.v140.windesktop.static.rt-dyn.1.7.0.1\build\native\include\gmock


    I've the exact same situation here (same packages version), but I've solved in another way (since the solution from @R.Evans didn't work).

    I've noticed that opening the Google Mock package there is a folder called gtest instead of gmock, and this name is hiding Google Test package. Uninstalling one, you can see the other one in the include path.

    Moreover all Google Mock headers are using gmock as main path for their headers, so with the header folder called gtest Visual Studio is reporting tons of errors even in the Google Mock source code.

提交回复
热议问题