Iam получают следующее сообщение об ошибке при построении моего проектаОшибка в GTEST-printers.h пока Intergrating GTEST к моему проекту
C:\gtest\gtest-1.6.0\include\gtest/gtest-printers.h(327) : error C2220: warning treated as error - no 'object' file generated
C:\gtest\gtest-1.6.0\include\gtest/gtest-printers.h(376) : see reference to function template instantiation 'void testing::internal::DefaultPrintTo<const void>(testing::internal::IsNotContainer,testing::internal::true_type,T *,std::ostream *)' being compiled
with
[
T=const void
]
C:\gtest\gtest-1.6.0\include\gtest/gtest-printers.h(416) : see reference to function template instantiation 'void testing::internal::PrintTo<To>(const T &,std::ostream *)' being compiled
with
[
To=const void *,
T=const void *
]
C:\gtest\gtest-1.6.0\include\gtest/gtest-printers.h(327) : warning C4826: Conversion from 'const void *' to 'testing::internal::UInt64' is sign-extended. This may cause unexpected runtime behavior.
Я инициализируется InitGoogleTest следующим образом,
Некоторых подробнее,
int main(int argc, char** argv)
{
char *option[] = { "test.exe", //it doesn't have meaning, just dummy
"--gtest_output=xml:gTestResults.xml" };
int myargc = 2;
testing::InitGoogleTest(&myargc, option);
RUN_ALL_TESTS();
getchar(); // keep console window open until Return keystroke
}
бросает также ошибку,
1>c:\...\gtestfactorial\gtestfactorial\gtestfactorial.cpp(4) : error C2220: warning treated as error - no 'object' file generated
Если параметр компилятора изменяется следующим образом в собственности проекта,
C/C++ -> Лечение предупреждения как ошибки -> NO
Затем IAM смог построить и запустить.