Lor*_*rin 9 c++ linux debian sdl-2
一天前我安装了一个SDL2库.它还没有在Debian Wheezy中,所以我使用了configure, make, make install命令.
毕竟,当我尝试使用SDL_Texture时,我收到此错误:
error: forward declaration of ‘SDL_Texture {aka struct SDL_Texture}’
invalid use of incomplete type ‘SDL_Texture {aka struct SDL_Texture}’
Run Code Online (Sandbox Code Playgroud)
在寻找声明后,我发现的所有内容都是SDL_render.h中的这两行:
struct SDL_Texture;
typedef struct SDL_Texture SDL_Texture;
Run Code Online (Sandbox Code Playgroud)
根本没有定义.我认为我的安装缺少文件SDL_sysrender.h.它是在我下载的源代码中,但不是在SDL2中包含路径.
哪里应该是问题?有必要使用任何标志配置文件?谢谢你的帮助.
gab*_*mdq 12
您的安装没有任何问题.SDL_Texture是一种设计上的opaque类型(也就是说,设计为仅在内部由SDL2操作),您可以"传递"作为指针,但是您无法访问内部(或者自己创建SDL_Texture,例如通过做一个malloc,因为你不知道结构的大小).如果坚持下去
SDL_Texture *blah;
Run Code Online (Sandbox Code Playgroud)
指针并将它们传递给SDL2函数你应该没问题.
SDL_sysrender.h是一个内部头文件,正如您所提到的,它实际上定义了SDL_Texture以供内部使用库.
| 归档时间: |
|
| 查看次数: |
4828 次 |
| 最近记录: |