添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Show hidden characters

1. Setup build tools

You can skip some of the following steps if you have already installed them.

  • Install Mingw-w64
  • Install Python3
  • Install GNU Make (Make for Windows GnuWin32 is sufficient)
  • Install CMake
  • 2. Build GoogleTest

    Download GoogleTest release package, extract it, and go to folder: googletest-release-x.x.x

    Run following commands

    cmake -G "MinGW Makefiles"
    

    3. Copy header and library files to your environment

    You may have to change Mingw-w64 path in the following instructions, according to your environment.

  • Copy 2 folders googletest-release-x.x.x/googletest/include/gtest and googletest-release-x.x.x/googletest/include/gmock to C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/include/
  • Copy gtest library files copy googletest-release-x.x.x/lib/libgtest*.a to C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/lib/gtest/
  • Copy gmock library files googletest-release-x.x.x/lib/libgmock*.a to C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/lib/gmock/
  • 4. Usage

    MathLib will help you know how to use GoogleTest.