用VS11编译gtest

今天想试用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。

posted on 2012-04-18 11:50  fresky  阅读(756)  评论(0编辑  收藏  举报

导航