prog.c: In function ‘main’:
prog.c:6:5: error: unknown type name ‘SDL_Window’
SDL_Window *sdlwindow;
^
prog.c:7:5: error: unknown type name ‘SDL_Renderer’
SDL_Renderer *sdlrenderer;
^
prog.c:9:5: error: implicit declaration of function ‘SDL_Init’ [-Werror=implicit-function-declaration]
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS) < 0) {
^
prog.c:9:17: error: ‘SDL_INIT_VIDEO’ undeclared (first use in this function)
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS) < 0) {
^
prog.c:9:17: note: each undeclared identifier is reported only once for each function it appears in
prog.c:9:34: error: ‘SDL_INIT_EVENTS’ undeclared (first use in this function)
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS) < 0) {
^
prog.c:10:9: error: implicit declaration of function ‘fprintf’ [-Werror=implicit-function-declaration]
fprintf(stderr, "failed to init SDL");
^
prog.c:10:9: error: incompatible implicit declaration of built-in function ‘fprintf’ [-Werror]
prog.c:10:17: error: ‘stderr’ undeclared (first use in this function)
fprintf(stderr, "failed to init SDL");
^
prog.c:14:5: error: implicit declaration of function ‘SDL_CreateWindowAndRenderer’ [-Werror=implicit-function-declaration]
if(SDL_CreateWindowAndRenderer(scale*width, scale*height, SDL_WINDOW_SHOWN, &sdlwindow, &sdlrenderer)) {
^
prog.c:14:63: error: ‘SDL_WINDOW_SHOWN’ undeclared (first use in this function)
if(SDL_CreateWindowAndRenderer(scale*width, scale*height, SDL_WINDOW_SHOWN, &sdlwindow, &sdlrenderer)) {
^
prog.c:15:9: error: incompatible implicit declaration of built-in function ‘fprintf’ [-Werror]
fprintf(stderr, "failed to open window");
^
prog.c:16:9: error: implicit declaration of function ‘SDL_Quit’ [-Werror=implicit-function-declaration]
SDL_Quit();
^
prog.c:20:5: error: unknown type name ‘SDL_Texture’
SDL_Texture *sdltexture = SDL_CreateTexture(sdlrenderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, width, height);
^
prog.c:20:5: error: implicit declaration of function ‘SDL_CreateTexture’ [-Werror=implicit-function-declaration]
prog.c:20:62: error: ‘SDL_PIXELFORMAT_ARGB8888’ undeclared (first use in this function)
SDL_Texture *sdltexture = SDL_CreateTexture(sdlrenderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, width, height);
^
prog.c:20:88: error: ‘SDL_TEXTUREACCESS_STREAMING’ undeclared (first use in this function)
SDL_Texture *sdltexture = SDL_CreateTexture(sdlrenderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, width, height);
^
prog.c:21:5: error: unknown type name ‘uint32_t’
uint32_t *pixels;
^
prog.c:24:11: error: ‘running’ undeclared (first use in this function)
while(running) {
^
prog.c:25:9: error: unknown type name ‘SDL_Event’
SDL_Event event;
^
prog.c:26:9: error: implicit declaration of function ‘SDL_PollEvent’ [-Werror=implicit-function-declaration]
while(SDL_PollEvent(&event)) {
^
prog.c:27:25: error: request for member ‘type’ in something not a structure or union
switch(event.type) {
^
prog.c:28:22: error: ‘SDL_KEYDOWN’ undeclared (first use in this function)
case SDL_KEYDOWN:
^
prog.c:29:29: error: request for member ‘key’ in something not a structure or union
if(event.key.keysym.sym == SDLK_ESCAPE) {
^
prog.c:29:48: error: ‘SDLK_ESCAPE’ undeclared (first use in this function)
if(event.key.keysym.sym == SDLK_ESCAPE) {
^
prog.c:36:9: error: implicit declaration of function ‘SDL_LockTexture’ [-Werror=implicit-function-declaration]
SDL_LockTexture(sdltexture, NULL, (void*)&pixels, &pitch);
^
prog.c:36:37: error: ‘NULL’ undeclared (first use in this function)
SDL_LockTexture(sdltexture, NULL, (void*)&pixels, &pitch);
^
prog.c:40:9: error: implicit declaration of function ‘SDL_UnlockTexture’ [-Werror=implicit-function-declaration]
SDL_UnlockTexture(sdltexture);
^
prog.c:41:9: error: implicit declaration of function ‘SDL_RenderCopy’ [-Werror=implicit-function-declaration]
SDL_RenderCopy(sdlrenderer, sdltexture, NULL, NULL);
^
prog.c:42:9: error: implicit declaration of function ‘SDL_RenderPresent’ [-Werror=implicit-function-declaration]
SDL_RenderPresent(sdlrenderer);
^
prog.c:46:5: error: implicit declaration of function ‘SDL_DestroyTexture’ [-Werror=implicit-function-declaration]
SDL_DestroyTexture(sdltexture);
^
prog.c:48:5: error: implicit declaration of function ‘SDL_DestroyWindow’ [-Werror=implicit-function-declaration]
SDL_DestroyWindow(sdlwindow);
^
cc1: all warnings being treated as errors