TorqueGameEngines / Torque2D

A completely free, open-source, 2D game engine built on proven torque technology.
MIT License
1.25k stars 110 forks source link

Compile gtest-all.cc failed to build on Windows with MSVC "error C2888: 'std::tuple_size<std::tr1::tuple<void,void,void,void,void,void,void,void,void,void>>': symbol cannot be defined within namespace 'tr1'" #39

Open YangYang129 opened 3 years ago

YangYang129 commented 3 years ago

Compile gtest-all.cc failed to "error C2888: 'std::tuple_size<std::tr1::tuple<void,void,void,void,void,void,void,void,void,void>>': symbol cannot be defined within namespace 'tr1'". It can reproduces on version be8ca31 . Could you please help look at this issue? Thank you very much Environment Compiler version: VS2019 (16.11.2) Operating system: Windows server 2016

Reproduce steps:

  1. git clone https://github.com/TorqueGameEngines/Torque2D F:\
  2. cd Torque2D\engine\source\testing\googleTest
  3. mkdir build_amd64test
  4. cd build_amd64test
  5. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release -Dgtest_build_tests=ON -DGTEST_USE_OWN_TR1_TUPLE=0 ..
  6. set CL=/wd4996
  7. msbuild /p:Configuration=Release;Platform=x64 gtest.sln /t:Rebuild /m

Error log: msbuildx64test.log

Error info: 34>F:\Torque2D\engine\source\testing\googleTest\include\gtest/internal/gtest-tuple.h(711,69): error C2888: 'std::tuple_size<std::tr1::tuple<void,void,void,void,void,void,void,void,void,void>>': symbol cannot be defined within namespace 'tr1' [F:\Torque2D\engine\source\testing\googleTest\build_amd64test\gtest_main_use_own_tuple.vcxproj] 34>F:\Torque2D\engine\source\testing\googleTest\include\gtest/internal/gtest-tuple.h(747,2): error C3855: 'std::tuple_element': template parameter '_Index' is incompatible with the declaration [F:\Torque2D\engine\source\testing\googleTest\build_amd64test\gtest_main_use_own_tuple.vcxproj] 34>F:\Torque2D\engine\source\testing\googleTest\include\gtest/internal/gtest-tuple.h(759,10): error C2039: 'type': is not a member of 'std::tuple_element' [F:\Torque2D\engine\source\testing\googleTest\build_amd64test\gtest_main_use_own_tuple.vcxproj] F:\Torque2D\engine\source\testing\googleTest\include\gtest/internal/gtest-tuple.h(744): message : see declaration of 'std::tuple_element' [F:\Torque2D\engine\source\testing\googleTest\build_amd64test\gtest_main_use_own_tuple.vcxproj] 34>F:\Torque2D\engine\source\testing\googleTest\include\gtest/internal/gtest-tuple.h(759,10): error C2146: syntax error: missing '>' before identifier 'type' [F:\Torque2D\engine\source\testing\googleTest\build_amd64test\gtest_main_use_own_tuple.vcxproj] 34>F:\Torque2D\engine\source\testing\googleTest\include\gtest/internal/gtest-tuple.h(759): error C2062: type 'unknown-type' unexpected [F:\Torque2D\engine\source\testing\googleTest\build_amd64test\gtest_main_use_own_tuple.vcxproj] 34>F:\Torque2D\engine\source\testing\googleTest\include\gtest/internal/gtest-tuple.h(759,10): error C2039: 'type': is not a member of '`global namespace'' [F:\Torque2D\engine\source\testing\googleTest\build_amd64test\gtest_main_use_own_tuple.vcxproj] 34>F:\Torque2D\engine\source\testing\googleTest\include\gtest/internal/gtest-tuple.h(760,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body [F:\Torque2D\engine\source\testing\googleTest\build_amd64test\gtest_main_use_own_tuple.vcxproj]