找不到标识符,即使使用依赖于参数的查找和运算符<<也不明确



在我的c++函数中,我试图这样做cout <<getVoxelWidth();,但这是我得到的2个错误

error C2593: 'operator <<' is ambiguouserror C3861: 'getVoxelWidth': identifier not found, even with argument-dependent lookup

我已经包含了getVoxelWidth所在的.h文件,这里是它是如何定义的。

const double getVoxelWidth() const { return getVoxelDim("voxel_size_x"); }

你的签名暗示了一个类函数,你把它当作一个自由函数来调用。

可能你指的是obj.getVoxelWidth()。在此之后,其他错误可能会消失或改变。

最新更新