且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C++ - 什么是“不允许不完整的类型"?错误的意思,我该如何解决?

更新时间:2022-06-23 05:07:13

C++ - Incomplete type not allowed"错误是什么意思

C++ - What does "Incomplete type not allowed" error mean

不完整类型意味着没有类型SDL_Window的定义.

Incomplete type means that there is no definition for the type SDL_Window.

该错误意味着该类型不完整,并且在该上下文中不允许使用不完整的类型.在这种特殊情况下:不完整的类型不能用作基类.

The error means that the type is incomplete, and that an incomplete type wasn't allowed in that context. In this particular case: an incomplete type cannot be used as a base class.

我应该怎么做才能阻止它发生?

what I should do to stop it from happening?

不要尝试使用 SDL_Window 作为基类 - 它不打算以这种方式使用.

Do not attempt to use SDL_Window as a base class - it is not intended to be used in that way.

SDL_Window 旨在用作不透明指针.某些 SDL 函数可能会返回一个 SDL_Window*.您可以存储它,并将其作为参数发送给其他 SDL 函数.这就是它的全部用途.

SDL_Window is intended to be used as an opaque pointer. Some SDL functions may return you a SDL_Window*. You can store it, and send it as an argument to other SDL functions. That is all it is used for.