# SDL2\_image not found

**URL:** <https://discourse.cmake.org/t/sdl2-image-not-found/4652>\
**Category:** Code\
**Created:** [December 13, 2021, 4:22pm UTC](https://discourse.cmake.org/t/sdl2-image-not-found/4652 "2021-12-13T16:22:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![greendragon](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/ce73a5/32.png) [@greendragon](https://discourse.cmake.org/u/greendragon)\
**Post date:** [December 13, 2021, 4:22pm UTC](https://discourse.cmake.org/t/sdl2-image-not-found/4652/1 "2021-12-13T16:22:52Z")

</div>

Hello,

I am trying to run the github project found at the link on the bottom of the page below:

> **[Using SDL2\_image with CMake](https://trenki2.github.io/blog/2017/07/04/using-sdl2-image-with-cmake/)**
>
> SDL2\_image is an add-on library for SDL2, the Simple DirectMedia Layer and can be used to load images from various formats. In this post I describe how to get it working with CMake under Windows and Linux.

When I run the project at cmake … I get the following error:

The C compiler identification is GNU 5.5.0

– The CXX compiler identification is GNU 7.5.0

– Check for working C compiler: /usr/bin/cc

– Check for working C compiler: /usr/bin/cc – works

– Detecting C compiler ABI info

– Detecting C compiler ABI info - done

– Detecting C compile features

– Detecting C compile features - done

– Check for working CXX compiler: /usr/bin/g+±7

– Check for working CXX compiler: /usr/bin/g+±7 – works

– Detecting CXX compiler ABI info

– Detecting CXX compiler ABI info - done

– Detecting CXX compile features

– Detecting CXX compile features - done

– Looking for pthread.h

– Looking for pthread.h - found

– Looking for pthread\_create

– Looking for pthread\_create - not found

– Looking for pthread\_create in pthreads

– Looking for pthread\_create in pthreads - not found

– Looking for pthread\_create in pthread

– Looking for pthread\_create in pthread - found

– Found Threads: TRUE

– Found SDL2: /usr/lib/x86\_64-linux-gnu/libSDL2.so;-lpthread

CMake Error at /usr/local/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):

Could NOT find SDL2\_image (missing: SDL2\_IMAGE\_LIBRARIES

SDL2\_IMAGE\_INCLUDE\_DIRS)

Call Stack (most recent call first):

/usr/local/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (\_FPHSA\_FAILURE\_MESSAGE)

cmake/FindSDL2\_image.cmake:93 (FIND\_PACKAGE\_HANDLE\_STANDARD\_ARGS)

CMakeLists.txt:8 (find\_package)

– Configuring incomplete, errors occurred!

See also “/home/workspace/SDL2Test/build/CMakeFiles/CMakeOutput.log”.

See also “/home/workspace/SDL2Test/build/CMakeFiles/CMakeError.log”.

I have a project with pngs and I am running this one first so I can then figure out how to make my own CMakeLists.txt.  
Any help would be much appreciated.  
Thanks.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [December 13, 2021, 10:45pm UTC](https://discourse.cmake.org/t/sdl2-image-not-found/4652/2 "2021-12-13T22:45:24Z")

</div>

You need `libsdl-image-dev`, `SDL2_image-devel`, or similar installed (depending on the distro you’re using) to have the SDL2\_image headers.
