Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SDL/SDL_image.h: No such file or directory

I'm trying to follow Lazy Foo's tutorials. But when I try to run one of his examples I get this compiler error:

error: SDL/SDL_image.h: No such file or directory

The compiler/linker is set up correctly, I'm using Code::Blocks on Windows XP.

However, the problem is simply that there are no SDL_image.h. I've checked in the folder that it supposedly should have been. I tried to download the SDL library again and checked again, still no SDL_image.h file. Where did the SDL_image.h file go?

The library I dowloaded was the 'SDL-devel-1.2.14-mingw32.tar.gz' under 'Development Libraries' for Win32 from this link: http://www.libsdl.org/download-1.2.php

like image 279
Knarf Avatar asked Jul 27 '11 11:07

Knarf


People also ask

How do I import a PNG file into SDL?

To use any SDL_image function or data types, we need to include the SDL_image header. We'd have to do the same for SDL_ttf, or SDL_mixer. Now that we're using SDL_image, we need to initialize it. Here we want to initialize SDL_image with PNG loading, so we pass in the PNG loading flags into IMG_Init.


1 Answers

You need to install SDL_image separately. It's not shipped with SDL.

like image 128
Piotr Praszmo Avatar answered Oct 05 '22 12:10

Piotr Praszmo