C ++:当我包含标题时,为什么我会在“此范围内声明”错误?

时间:2015-09-29 22:51:32

标签: android c++

在我的代码中,我使用了一个类CameraHeapMemory,它由this header在第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"
然后

my code使用以下行:

 sp<CameraHeapMemory> mem(static_cast<CameraHeapMemory *>(data->handle));

但是当我编译时,我得到:

  error: 'CameraHeapMemory' was not declared in this scope"

谁能明白为什么?

1 个答案:

答案 0 :(得分:1)

'CameraHeapMemory'似乎是'CameraHardwareInterface'中定义的私有类。在“CameraHardwareInterface”之外无法访问它。