“SceneElement”未在此范围内声明
‘SceneElement’ was not declared in this scope
我想在我的3d查看器中使用选择,我尝试了这个例子,但我遇到了以下问题:
错误:"场景元素"未在此范围内声明 QList场景元素 ;
场景.h 文件:
#ifndef SCENE_H
#define SCENE_H
#include <sceneelement.h>
#include <QGLViewer/qglviewer.h>
class Scene
{
private:
/// The list of elements that make up the scene
QList <SceneElement*> sceneElements ;
public:
Scene();
/// Creates a scene with RenderElements positionned on a regular grid.
/// Consider increasing selectBufferSize() if you use more RenderElements.
void draw();
void setSelected(int i);
void drawWithNames();
void clearSelection();
};
场景元素.h 文件:
#include <QGLViewer/qglviewer.h>
#include <viewer.h>
class SceneElement
{
friend class Scene;
private:
qglviewer::Frame frame;
bool isSelected;
public:
/// Constructor
SceneElement(float x, float y){
isSelected=false;
qglviewer::Vec pos(x,y,0.0);
frame.setPosition(pos);
}
/// Draws this element
void draw() const;
};
我不知道为什么它不能使用SceneElement,尽管我包含了siteelement.h
我感谢任何帮助,谢谢。
该建议解决了我的问题看起来您有一个循环依赖关系。尝试在 scene.h 中的行类 Scene 之前添加一个前向声明类 SceneElement – Romha Korev
相关文章:
- 错误:未在此范围内声明'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'未在此范围内声明