I am trying to build Google Test using Visual Studio 2015 on Windows 10. I'll describe my exact method here in bullet point form (to make it clear exactly what I did). If this doesn't fit the site's format please tell me and I'll change it.
- Download the Google Test source code from the GitHub page here, using the Download ZIP button on the right.
- Extract the zip file to, for this example,
C:\
- Open CMake. I am using CMake 3.5.0-rc3 (cmake.org).
- For "Where is the source code:", put
C:/googletest-master/googletest
- For "Where to build the binaries:", put
C:/googletest-master/googletest/build
- Click Configure. Say yes to the Create Directory dialog.
- It will ask you to specify a generator. Choose
Visual Studio 14 2015
. In my case "Use default native compilers" is selected. Click Finish. - 8 configuration values will come up in red. Ignore these and click Generate.
- Open
C:\googletest-master\googletest\build\gtest.sln
in Visual Studio 2015. - In Solution Explorer, right click ALL_BUILD and select Build.
The build fails, and the output window (build) displays no more useful info than the following:
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 9009.
2>------ Build started: Project: gtest, Configuration: Debug Win32 ------
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 9009.
3>------ Build started: Project: gtest_main, Configuration: Debug Win32 ------
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 9009.
4>------ Build started: Project: ALL_BUILD, Configuration: Debug Win32 ------
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 9009.
========== Build: 0 succeeded, 4 failed, 0 up-to-date, 0 skipped ==========
What important step have I missed? I have tried:
- Temporarily disabling Avast antivirus which has caused previous problems.
- Running VS in Administrator mode in case of permission issues.
- Closing all explorer windows (even stopping the explorer.exe process) as suggested here.
A google search for "google test" "exited with code 9009"
returns only 9 results and these don't seem too relevant.