I have the following problem, I am trying to add testing the my project and opted for GTest.
Downloaded from nuget like all the mortals and while compiling have the following error:
error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1900' in Source.obj
Followed by quite a few unresolved external linking errors.
As far as I understand there is a versioning problem here, but none of the answers on SO was useful for me.
This is the simplest example I use:
#define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING 1
#define GTEST_LANG_CXX11 1
#include <iostream>
#include <gtest/gtest.h>
struct Account
{
int balance;
Account() = default;
explicit Account(const int& bal) :
balance{ bal }
{}
};
TEST(AccountTest, AccountEmpty)
{
Account acc;
EXPECT_EQ(0, acc.balance);
}
int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
VS version 2019
GTest version 1.7.0
Has anyone has encountered this issue or does anyone have an idea how to solve it?