【发布时间】:2020-03-05 09:26:29
【问题描述】:
VS19 更新到 16.3.8 后,我无法构建我的项目,并收到以下错误:
C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\inc\Kinect.h(8574,28): error C2872: 'boolean': ambiguous symbol
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\rpcndr.h(193,23): message : could be 'unsigned char boolean'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\concepts(213,9): message : or 'bool std::boolean'
我试图检查 kinect.h 标头,但我没有修改它的权限,我不想弄乱我不熟悉的东西。它曾经在更新之前工作(VS19 16.0.0)。我还尝试清理、重新启动并仔细检查任何 using 命名空间,但错误仍然存在。
根据错误:
concepts file 包含以下行
#define _STL_BOOLEAN_CONCEPT boolean
rpcndr.h
typedef unsigned char boolean;
然后是kinect.h
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsInertial(
/* [annotation][out][retval] */
_Out_ boolean *value) = 0;
【问题讨论】:
-
我的猜测是您的代码中有这一行
using namespace std;,这会导致与您正在使用的库发生冲突。 -
@drescherjm 我已经删除了 using namespace std;从我的代码中,在询问之前。
-
您可能需要重新编译干净,尤其是在使用预编译头文件时。并确保您使用的其他标头没有 .
using namespace std; -
您使用的是什么
c++语言标准?可能您可以将其设置回c++17而不会得到这个。 https://stackoverflow.com/questions/41308933/how-to-enable-c17-compiling-in-visual-studio