我将在Visual Studio 2013或Visual Studio 2019中编译旧项目(Visual Studio 2012 Platform-v110xp)。
它使用了boost
和Microsoft detour 3.0
库。
但是detour 3.0
已被意外删除。
现在我只能找到detour4.0
。
但我收到这样的错误
我如何获得detour 3.0
库?
最佳答案
使用VS 2015,VS 2017或VS 2019构建的C++静态库是“二进制兼容的”,但是Visual C++的任何其他版本都不是。例如,当与VS 2013代码链接时,与VS 2012链接的静态库不一定有效。参见Microsoft Docs。
我不知道确切涉及哪些工具集,但这可能是链接问题的原因。最主要的是确保所有静态库和主要可执行文件均由同一编译器版本构建。
Note that DLLs and their export libraries typically use only "C-style" binding so they can be binary compatible with multiple generations of compilers.
VS 2019包含
v141_xp
平台工具集(即使用与Windows XP/Windows Server 2003兼容的Windows 7.1A SDK的VS 2017编译器)。
关于boost - 需要在Visual Studio中编译缺少的 `detour 3.0`库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64745178/