简体   繁体   English

无法使用SDL_gfxPrimitive

[英]Cannot use SDL_gfxPrimitive

I´m trying to use the filledCircleRGBA function from the _gfxPrimitive lib from SDL2, but it says 'fatal error:SDL2_gfxPrimitives.h: No such file or directory 我正在尝试使用SDL2的_gfxPrimitive库中的fillCircleRGBA函数,但提示“致命错误:SDL2_gfxPrimitives.h:无此类文件或目录

I have both includes and I use -lSDL2 and -lSDL2_gfx on the command line 我都包含了,并且在命令行上使用-lSDL2和-lSDL2_gfx

#include <SDL.h>    
#include <SDL2_gfxPrimitives.h>

int main() {
    SDL_Window* g_pWindow = NULL;
    filledCircleRGBA(g_pWindow, 2, 4, 4, 255, 255, 255, 255);

return 0;
}

Why can´t I use _gfxPrimitives functionalities? 为什么不能使用_gfxPrimitives功能? I have the -dev SDL2 installed, so it should have all the libs 我安装了-dev SDL2,因此它应该具有所有库

Installed with SDL2 is sdl2-config , a program which you run with parameter --cflags or --libs . 与SDL2 sdl2-config安装的是sdl2-config ,这是一个使用参数--cflags--libs运行的程序。 Pass the output of using either parameter to your compiler and linker, respectively. 将使用任何一个参数的输出分别传递给编译器和链接器。 --cflags is particularly what you need, as it instructs the compiler to add the SDL2 include directory to your compiler's search path. --cflags特别需要您,因为它指示编译器将SDL2 include目录添加到编译器的搜索路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM