今天想试用visual stuido11做个小程序,打算做成TDD的样子,编译gtest的时候报如下的错:
<code><span class="pln">test\gtest.h(9735): error C2977: 'std::tuple' : too many template arguments
c:\program files (x86)\microsoft visual studio 11.0\vc\include\utility(72) : see declaration of 'std::tuple'
...
Google了一下,发现<a href="http://stackoverflow.com/questions/9589192/how-do-i-change-the-number-of-template-arguments-supported-by-msvcs-stdtupl">c++ - How do I change the number of template arguments supported by MSVC++'s std::tuple? - Stack Overflow</a>解释了原因,因为VS11把宏 _VARIADIC_MAX定义改成了5。
解决方法是打开 c:\program files (x86)\Microsoft Visual Studio 11.0\VC\include\xstddef,把 _VARIADIC_MAX定义成10。

相关文章:

  • 2022-12-23
  • 2021-12-05
  • 2022-02-22
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2021-09-28
  • 2022-02-10
猜你喜欢
  • 2021-04-29
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2021-11-13
  • 2021-08-29
  • 2021-10-16
相关资源
相似解决方案