C++:为什么在包含标头时收到"未在此范围内声明"错误?
C++: Why do I get a ´not declared in this scope´ error when I included the header?
在我的代码中,我使用了一个类CameraHeapMemory
,它由第491行标题定义,如下所示:
class CameraHeapMemory : public RefBase {
public:
CameraHeapMemory(int fd, size_t buf_size, uint_t num_buffers = 1) :
mBufSize(buf_size),
mNumBufs(num_buffers)
我在源代码中使用include:
#include "CameraHardwareInterface.h"
我的代码然后使用如下行:
sp<CameraHeapMemory> mem(static_cast<CameraHeapMemory *>(data->handle));
但是当我编译时,我得到:
error: 'CameraHeapMemory' was not declared in this scope"
有人知道为什么吗?
'CameraHeapMemory'似乎是在'CameraHardwareInterface'中定义的私有类。在"CameraHardwareInterface"之外无法访问。
相关文章:
- 错误:未在此范围内声明'reverse'
- 错误:"imread"未在此范围内声明
- 未在此范围内声明错误 'xy'
- Socklen_t未在此范围内声明
- 错误:'[' 之前预期的非限定 id 和错误:'users'未在此范围内声明
- "Main"已在当前范围内声明
- c++ 变量在宏的扩展中没有在这个范围内声明
- C++ 在编译过程中 strtok 函数 Eclipse 说没有在范围内声明?
- 'num1'未在此范围内声明
- 如何找到在本地范围内声明的变量的地址?
- NT状态未在此范围内声明
- 变量未在此范围内声明 数组线性搜索
- 包含文件中的 Typdef "未在此范围内声明"
- 'ClassName'和'ClassInstance'未在此范围内声明
- C++ 中的类之间的数据重新循环 - 错误:'<class name>'未在此范围内声明
- 代码作为 C 文件工作,但不作为C++文件,错误:'__builtin_types_compatible_p'未在此范围内声明
- 如何修复错误:"vreinterpretq_u32_f64"未在此范围内声明 - 在Android上使用Eigen构建
- 如何修复C++中的"arrStud未在此范围内声明"错误
- 错误:"SHGetKnownFolderPath"未在此范围内声明
- 错误:'Sprite'未在此范围内声明