1. 編譯時,error C2977 "std::tuple" too many template arguments問題的解決辦法
打開 c:\program files (x86)\Microsoft Visual Studio 11.0\VC\include\xstddef,把 _VARIADIC_MAX定義成10。
這個方案一方面需要Administrator,其實是需要System權限才能修改Windows 8中的System文件,另一方面,會對所有的C/C++代碼造成影響
坑爹吧?
/////////////////////////////////////////////
// date: 2012-12-11
上面的問題是vc的tr1/tuple引起的,后來高手指點下知道gtest是有一個宏來控制這個東東的,,,
// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
// is/isn't available.
// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
// compiler supports Microsoft's "Structured
// Exception Handling".
// GTEST_HAS_STREAM_REDIRECTION
// - Define it to 1/0 to indicate whether the
// platform supports I/O stream redirection using
// dup() and dup2().
// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
// Test's own tr1 tuple implementation should be
// used. Unused when the user sets
// GTEST_HAS_TR1_TUPLE to 0.
// Determines whether Google Test can use tr1/tuple. You can define
// this macro to 0 to prevent Google Test from using tuple (any
// feature depending on tuple with be disabled in this mode).
#ifndef GTEST_HAS_TR1_TUPLE
// The user didn't tell us not to do it, so we assume it's OK.
# define GTEST_HAS_TR1_TUPLE 1
#endif // GTEST_HAS_TR1_TUPLE
// Determines whether Google Test's own tr1 tuple implementation
// should be used.
#ifndef GTEST_USE_OWN_TR1_TUPLE
// The user didn't tell us, so we need to figure it out.
using vs2012
gtest tuple build error
gtestport.h
#define GTEST_USE_OWN_TR1_TUPLE 0
#define GTEST_HAS_TR1_TUPLE 0