繁体   English   中英

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 "CameraHardwareInterface.h"

我的代码然后使用该行如下:

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

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

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

谁能看出为什么?

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM