我在 VS2012 下使用 boost 1_62_0 编译我们的一个程序时遇到了一些问题。我相信我以前曾在 VS2015 下进行过此编译(但无法验证这一点)。
我打开了 /showIncludes
来了解它到底在哪里有问题,我已经将它缩小到包含 VS2012 中的 typeindex
包括:
Note: including file: C:\PROGRA~2\MICROS~3.0\VC\include\crtdefs.h^M
Note: including file: \\COMPILESERVER\BASENT\dev\lib\src\third_party\boost\boost_latest_win64_vs2012\boost/limits.hpp^M
Note: including file: \\COMPILESERVER\BASENT\dev\lib\src\third_party\boost\boost_latest_win64_vs2012\boost/limits.hpp^M
Note: including file: \\COMPILESERVER\BASENT\dev\lib\src\third_party\boost\boost_latest_win64_vs2012\boost/type_traits/is_enum.hpp^M
Note: including file: \\COMPILESERVER\BASENT\dev\lib\src\third_party\boost\boost_latest_win64_vs2012\boost/type_traits/is_integral.hpp^M
Note: including file: \\COMPILESERVER\BASENT\dev\lib\src\third_party\boost\boost_latest_win64_vs2012\boost/utility/enable_if.hpp^M
Note: including file: \\COMPILESERVER\BASENT\dev\lib\src\third_party\boost\boost_latest_win64_vs2012\boost/cstdint.hpp^M
Note: including file: C:\PROGRA~2\MICROS~3.0\VC\include\typeindex^M
\\COMPILESERVER\BASENT\dev\lib\src\third_party\boost\boost_latest_win64_vs2012\boost/functional/hash/hash.hpp(236) : error C2039: 'UINT64' : is not a member of 'boost'^M
\\COMPILESERVER\BASENT\dev\lib\src\third_party\boost\boost_latest_win64_vs2012\boost/functional/hash/hash.hpp(237) : error C2039: 'UINT64' : is not a member of 'boost'^M
Note: including file: \\COMPILESERVER\BASENT\dev\lib\src\third_party\boost\boost_latest_win64_vs2012\boost/functional/hash/extensions.hpp^M
使用#pragma message,我可以验证它是否在 cstdint.hpp 的 boost 命名空间内 using::uint64_t
关于如何解决这个问题有什么想法吗?
最佳答案
确实,这闻起来像一个 MACRO。
你应该找出哪个 header 定义了类似的东西
#define uint64_t UINT64
您可以保存失败翻译单元的预处理器输出以找到它。
关于c++ - UINT64 不是 boost 的成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40735850/