我想从.off文件中对被视为Linear_cell_complex_for_bgl_combinatorial_map_helper的3d对象应用QGLViewer multiselect
我在GitHub here上的项目
它显示了有关使用GLViewer/constraint.h的错误,如下所示:
/usr/include/QGLViewer/constraint.h:117:24: error: variable ‘qglviewer::QGLVIEWER_EXPORT qglviewer::Constraint’ has initializer but incomplete type
class QGLVIEWER_EXPORT Constraint
^~~~~~~~~~
/usr/include/QGLViewer/constraint.h:119:1: error: expected primary-expression before ‘public’
public:
^~~~~~
/usr/include/QGLViewer/constraint.h:119:1: error: expected ‘}’ before ‘public’
/usr/include/QGLViewer/constraint.h:118:1: note: to match this ‘{’
{
^
/usr/include/QGLViewer/constraint.h:119:1: error: expected ‘,’ or ‘;’ before ‘public’
public:
^~~~~~
/usr/include/QGLViewer/constraint.h:133:2: error: ‘virtual’ outside class declaration
virtual void constrainTranslation(Vec& translation, Frame* const frame) { Q_UNUSED(translation); Q_UNUSED(frame); }
^~~~~~~
/usr/include/QGLViewer/constraint.h:133:36: error: variable or field ‘constrainTranslation’ declared void
virtual void constrainTranslation(Vec& translation, Frame* const frame) { Q_UNUSED(translation); Q_UNUSED(frame); }
^~~
/usr/include/QGLViewer/constraint.h:133:36: error: ‘Vec’ was not declared in this scope
/usr/include/QGLViewer/constraint.h:133:36: note: suggested alternative:
In file included from /usr/local/include/CGAL/Qt/qglviewer.h:26,
from /usr/local/include/CGAL/Qt/Basic_viewer_qt.h:40,
from /usr/local/include/CGAL/draw_linear_cell_complex.h:24,
from ../Projects/CM2/mainwindow.h:13,
from ../Projects/CM2/main.cpp:2:
/usr/local/include/CGAL/Qt/vec.h:64:22: note: ‘CGAL::qglviewer::Vec’
class CGAL_QT_EXPORT Vec {
^~~
In file included from ../Projects/CM2/manipulatedframesetconstraint.h:3,
from ../Projects/CM2/mainwindow.h:36,
from ../Projects/CM2/main.cpp:2:
/usr/include/QGLViewer/constraint.h:133:41: error: ‘translation’ was not declared in this scope
virtual void constrainTranslation(Vec& translation, Frame* const frame) { Q_UNUSED(translation); Q_UNUSED(frame); }
^~~~~~~~~~~
/usr/include/QGLViewer/constraint.h:133:41: note: suggested alternative: ‘QTranslator’
virtual void constrainTranslation(Vec& translation, Frame* const frame) { Q_UNUSED(translation); Q_UNUSED(frame); }
^~~~~~~~~~~
QTranslator
/usr/include/QGLViewer/constraint.h:133:59: error: expected primary-expression before ‘*’ token
virtual void constrainTranslation(Vec& translation, Frame* const frame) { Q_UNUSED(translation); Q_UNUSED(frame); }
^
/usr/include/QGLViewer/constraint.h:133:61: error: expected primary-expression before ‘const’
virtual void constrainTranslation(Vec& translation, Frame* const frame) { Q_UNUSED(translation); Q_UNUSED(frame); }
^~~~~
/usr/include/QGLViewer/constraint.h:142:2: error: ‘virtual’ outside class declaration
virtual void constrainRotation(Quaternion& rotation, Frame* const frame) { Q_UNUSED(rotation); Q_UNUSED(frame); }
^~~~~~~
/usr/include/QGLViewer/constraint.h:142:33: error: variable or field ‘constrainRotation’ declared void
virtual void constrainRotation(Quaternion& rotation, Frame* const frame) { Q_UNUSED(rotation); Q_UNUSED(frame); }
^~~~~~~~~~
/usr/include/QGLViewer/constraint.h:142:33: error: ‘Quaternion’ was not declared in this scope
/usr/include/QGLViewer/constraint.h:142:33: note: suggested alternative:
In file included from /usr/local/include/CGAL/Qt/camera.h:27,
from /usr/local/include/CGAL/Qt/qglviewer.h:27,
from /usr/local/include/CGAL/Qt/Basic_viewer_qt.h:40,
from /usr/local/include/CGAL/draw_linear_cell_complex.h:24,
from ../Projects/CM2/mainwindow.h:13,
from ../Projects/CM2/main.cpp:2:
/usr/local/include/CGAL/Qt/quaternion.h:69:22: note: ‘CGAL::qglviewer::Quaternion’
class CGAL_QT_EXPORT Quaternion {
^~~~~~~~~~
In file included from ../Projects/CM2/manipulatedframesetconstraint.h:3,
from ../Projects/CM2/mainwindow.h:36,
from ../Projects/CM2/main.cpp:2:
/usr/include/QGLViewer/constraint.h:142:45: error: ‘rotation’ was not declared in this scope
virtual void constrainRotation(Quaternion& rotation, Frame* const frame) { Q_UNUSED(rotation); Q_UNUSED(frame); }
^~~~~~~~
/usr/include/QGLViewer/constraint.h:142:45: note: suggested alternative: ‘QAction’
virtual void constrainRotation(Quaternion& rotation, Frame* const frame) { Q_UNUSED(rotation); Q_UNUSED(frame); }
^~~~~~~~
QAction
/usr/include/QGLViewer/constraint.h:142:60: error: expected primary-expression before ‘*’ token
virtual void constrainRotation(Quaternion& rotation, Frame* const frame) { Q_UNUSED(rotation); Q_UNUSED(frame); }
^
/usr/include/QGLViewer/constraint.h:142:62: error: expected primary-expression before ‘const’
virtual void constrainRotation(Quaternion& rotation, Frame* const frame) { Q_UNUSED(rotation); Q_UNUSED(frame); }
^~~~~
/usr/include/QGLViewer/constraint.h:168:44: error: expected initializer before ‘:’ token
class QGLVIEWER_EXPORT AxisPlaneConstraint : public Constraint
^
/usr/include/QGLViewer/constraint.h:279:40: error: expected initializer before ‘:’ token
class QGLVIEWER_EXPORT LocalConstraint : public AxisPlaneConstraint
^
/usr/include/QGLViewer/constraint.h:299:40: error: expected initializer before ‘:’ token
class QGLVIEWER_EXPORT WorldConstraint : public AxisPlaneConstraint
^
/usr/include/QGLViewer/constraint.h:319:41: error: expected initializer before ‘:’ token
class QGLVIEWER_EXPORT CameraConstraint : public AxisPlaneConstraint
^
/usr/include/QGLViewer/constraint.h:336:1: error: expected declaration before ‘}’ token
} // namespace qglviewer
^所有的错误都显示在Constraint.h中,它已经在QGLViewer中了,所以我不知道问题出在哪里。
感谢您的帮助,谢谢
发布于 2019-09-03 22:26:53
总结解决方案:使用来自/usr/local/include/CGAL/Qt/QGLViewer而不是来自/usr/local/include/QGLViewer的包含文件
在您的代码中,使用名称空间为CGAL::qglviewer::的类型,而不仅仅是qglviewer::
https://stackoverflow.com/questions/57670237
复制相似问题