2

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.

Community
  • 1
  • 1
matt_rule
  • 1,220
  • 1
  • 12
  • 23
  • SO has same question regarding to the [exited code 9009](http://stackoverflow.com/questions/12069464/msb6006-cmd-exe-exited-with-code-9009). In the other hand, I recommend to you to build directly through cmake + dos prompt and not from the IDE, with this you can see if any error/warnings are output during configuration time. – Joel Apr 02 '16 at 17:37
  • Thanks Joel, I would do this in future, but I have a half-solution now. 9009 means the requested file was not found, as indicated by your link. So perhaps there is some issue with CMakeLists.txt. I now see that they intended users to use the Visual Studio project files already included under `googletest-master\googletest\msvc`. If I had read [this page](https://blog.jetbrains.com/rscpp/unit-testing-google-test/) carefully I would have seen this. Once upgraded to the latest MSVC version these files work as long as you're aware of if you're linking statically or dynamically in each project. – matt_rule Apr 02 '16 at 17:51

0 Answers0