c++ - C++ 二进制兼容性真的在 VS 2015 和 VS 2019 之间有效吗?
问题描述
我在我的 vc++ 项目中使用 Google 测试库(基于 Visual Studio 2015 中的平台工具集 v140 构建),该项目还在 Visual Studio 2015 中的平台工具集 v140 中构建。到目前为止一切正常。
现在,当我将我的项目迁移到 Visual Studio 2019(到平台工具集 v142),但想使用基于 v140 构建的相同 Google 测试库时,我得到以下 google 测试库的链接错误。
错误 LNK2019 无法解析外部符号“public: __cdecl testing::Message::Message(void)” (??0Message@testing@@QEAA@XZ) 在函数“private: virtual void __cdecl VideoProbeGoogleTest::BlobAutoDetector_BlobCreateGrayImageInRegion_Test::TestBody(void )" (?TestBody@BlobAutoDetector_BlobCreateGrayImageInRegion_Test@VideoProbeGoogleTest@@EEAAXXZ) WAI_VideoProbeBlobTest
错误 LNK2019 未解析的外部符号“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) 在函数“private: void __cdecl testing::AssertionResult::AppendMessage(class testing::Message const &)”中引用( ?AppendMessage@AssertionResult@testing@@AEAAXAEBVMessage@2@@Z))
但据微软称,他们提供了 Visual Studio 2015、2017 和 2019 版本之间的二进制兼容性。 https://docs.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=vs-2019
我在这里做错什么了吗?为什么兼容性在我的情况下不起作用?
解决方案
推荐阅读
- postgresql - 更新具有复合键作为主键的表查询
- ionic-framework - ionic1 中的自动更新应用程序
- android - 在“弹出”窗口中仅显示一个文本视图
- javascript - (Nuxt.js/Vue.js) - 脚本只运行一次,更改路由/刷新页面后停止运行
- flutter - 不同的使用事务和使用添加到 Firestore
- sorting - 需要帮助使用公式进行排序或分组
- grails - 无法在 STS 4.1.2 上安装 GGTS
- python-3.x - 如何将 pandas.rolling().mean 用于 3D 输入数组?
- docker - 使用 docker 部署闪亮的应用程序时如何解决 GKE 拒绝连接的问题
- python-3.6 - 有没有一种方法,一旦用逗号转换数字,数字可以保持为整数吗?