c++ struct does not name a type

后端 未结 1 1316
臣服心动
臣服心动 2020-12-21 00:02

I am defining a structure in a header file, and then setting its members in the corrosponding .cpp file. For doing this I am using a function that is supposed to create a (s

相关标签:
1条回答
  • 2020-12-21 00:04

    You need to qualify Drawable in the cpp file:

    GLWindow::Drawable GLWindow :: CreateDrawable(GLfloat *C_vertices, GLfloat *C_tex, GLfloat *C_normals, GLushort *C_facedata, int faces)
    

    In the cpp file, outside the member methods, you're operating outside the class context. Inside the methods you can use Drawable, but outside (including return type), you need to use GLWindow::Drawable.

    That's if you're actually returning a Drawable from the method, not a void - also an error.

    0 讨论(0)
提交回复
热议问题