Google Test in Visual Studio 2012

后端 未结 4 1133
你的背包
你的背包 2021-01-30 20:12

I am trying to get started with unit testing. I downloaded the latest build of gtest, and extracted it to A:\\gtest As the instructions specified, I opened gtest.sl

4条回答
  •  失恋的感觉
    2021-01-30 20:52

    Rather than modifying the VS2012 tuple implementation using the _VARIADIC_MAX macro, I solved this problem by defining the following two macros on the gtest projects and projects including gtest headers:

    GTEST_HAS_TR1_TUPLE=0
    GTEST_USE_OWN_TR1_TUPLE=1
    

    Setting GTEST_HAS_TR1_TUPLE to 0 prevents gtest trying to use the tuple class from the STL headers, and setting GTEST_USE_OWN_TR1_TUPLE to 1 instructs gtest to use its own tuple implementation rather than omitting features that require tuple support. I personally preferred this option to tweaking the STL implementation, and this solution should work on any other compilers that have similar problems.

提交回复
热议问题