日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

Visual Studio2012 编译 gtest 遇到 error C2977: ‘std::tuple‘ : too many template argum...

發(fā)布時間:2023/12/14 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Visual Studio2012 编译 gtest 遇到 error C2977: ‘std::tuple‘ : too many template argum... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

問題描述:

今天想試用visual stuido11做個小程序,打算做成TDD的樣子,編譯gtest的時候報如下的錯:

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’

因為VS11在 xstddef.h中 把宏 _VARIADIC_MAX默認定義改成了5,而gtest中的頭文件將其定義為10,不一致導致重定義,并引發(fā)了一系列錯誤與警告。


解決方案:

打開 c:\program files (x86)\Microsoft Visual Studio 11.0\VC\include\xstddef,把 _VARIADIC_MAX定義成10

總結(jié)

以上是生活随笔為你收集整理的Visual Studio2012 编译 gtest 遇到 error C2977: ‘std::tuple‘ : too many template argum...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。