0

I am using Google Test library(built on platform toolset v140 in visual studio 2015) in my vc++ project, which also builds in platform toolset v140 in visual studio 2015. Everything working fine till this point.

Now when I migrate my project to visual studio 2019(to platform toolset v142), but want to use same Google test library which was built on v140, I am getting below linking errors of google test library.

Error LNK2019 unresolved external symbol "public: __cdecl testing::Message::Message(void)" (??0Message@testing@@QEAA@XZ) referenced in function "private: virtual void __cdecl VideoProbeGoogleTest::BlobAutoDetector_BlobCreateGrayImageInRegion_Test::TestBody(void)" (?TestBody@BlobAutoDetector_BlobCreateGrayImageInRegion_Test@VideoProbeGoogleTest@@EEAAXXZ) WAI_VideoProbeBlobTest

Error LNK2019 unresolved external symbol "public: class std::basic_string,class std::allocator > __cdecl testing::Message::GetString(void)const " (?GetString@Message@testing@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "private: void __cdecl testing::AssertionResult::AppendMessage(class testing::Message const &)" (?AppendMessage@AssertionResult@testing@@AEAAXAEBVMessage@2@@Z))

But According to the Microsoft, they are giving binary compatibility between visual studio 2015, 2017 and 2019 versions. https://learn.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=vs-2019

Am I doing anything wrong here? why compatibility is not working in my case?

kumar
  • 1
  • 1
  • How did you do your migration of the project? If you compare project settings with the old VS2015 project, are all the linker settings the same? Are all object/source files listed that should be listed? – Some programmer dude Jan 30 '20 at 07:11
  • To migrate to VS2019, I just opened my mfc project in vs 2019 then in the settings->Configuration Properties->General->Platform Toolset, changed to Visual Studio 2019(v142). Yes I compared settings in old VS2015 and new VS2019, both are same. – kumar Jan 30 '20 at 10:08
  • Is VS2015 compiled library compiled with [/ GL](https://learn.microsoft.com/en-us/cpp/build/reference/gl-whole-program-optimization?view=vs-2019)compiler switch? – Jeaninez - MSFT Jan 31 '20 at 06:51

0 Answers0