Getting this error, I changed the
c/C++ > Code Generation > Runtime Library to Multi-threaded library (DLL) /MD
for both code project and associated Google Test project. This solved the issue.
Note: all components of the project must have the same definition in c/C++ > Code Generation > Runtime Library. Either DLL or not DLL, but identical.