Using googletest on VS2012

If you ever wanted to play with googletest framework on microsoft visual studio 2012, you will be end up disappointing with numerous unfriendly error messages like below.

error

But having simple work-around macro definition, you can still enjoy gtest on vs2012.

solution

The macro definition should be applied all four projects under gtest solution. I mean gtest, gtest_main, gtest_prod_test and gtest_unittest.

Once you built gtest library, apply the generated gtest lib file as well as gtest header files under your application configuration.

And above macro definition, _VARIADIC_MAX=10, should also be applied to your application configuration as well.

Then, yay, it works.

output

Advertisements

About sydlife

Lazy programmer, Dad and Husband.
%d bloggers like this: