Severity Code Description Project File Line Suppression State Details
Error C2440 'initializing': cannot convert from 'initializer list' to 'int' Sample-Test1 C:\Projects\C++\DataStructuresAlgorithms\Sample-Test1\test.cpp 29
Error C2065 'MyTests': undeclared identifier Sample-Test1 C:\Projects\C++\DataStructuresAlgorithms\Sample-Test1\test.cpp 30
Error C2275 'TestFixture': expected an expression instead of a type Sample-Test1 C:\Projects\C++\DataStructuresAlgorithms\Sample-Test1\test.cpp 31
Error (active) E0020 identifier "MyTests" is undefined Sample-Test1 C:\Projects\C++\DataStructuresAlgorithms\Sample-Test1\test.cpp 30
Error (active) E0392 member function "TestFixture_MyTests_Test::TestBody" may not be redeclared outside its class Sample-Test1 C:\Projects\C++\DataStructuresAlgorithms\Sample-Test1\test.cpp 25
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Sample-Test1 C:\Projects\C++\DataStructuresAlgorithms\Sample-Test1\test.cpp 29
Error (active) E0077 this declaration has no storage class or type specifier Sample-Test1 C:\Projects\C++\DataStructuresAlgorithms\Sample-Test1\test.cpp 29
Error (active) E0254 type name is not allowed Sample-Test1 C:\Projects\C++\DataStructuresAlgorithms\Sample-Test1\test.cpp 31
Description
Follow this page: https://learn.microsoft.com/en-us/visualstudio/test/how-to-use-google-test-for-cpp?view=vs-2022&source=docs but the test never builds successfully!
Steps to reproduce
.vcsproj
:pch.h
:test.cpp
:Expected behavior
Builds and runs without any error, duh!
Actual behavior
Build errors:
Diagnostic logs
Environment
Windows 11, Visual Studio 17.10.3