# SDL\_image problems

**URL:** <https://discourse.libsdl.org/t/sdl-image-problems/34239>\
**Category:** SDL Development\
**Created:** [December 31, 2021, 11:23pm UTC](https://discourse.libsdl.org/t/sdl-image-problems/34239 "2021-12-31T23:23:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GustaveBC](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/c67d28/32.png) [@GustaveBC](https://discourse.libsdl.org/u/GustaveBC)\
**Post date:** [December 31, 2021, 11:23pm UTC](https://discourse.libsdl.org/t/sdl-image-problems/34239/1 "2021-12-31T23:23:46Z")

</div>

Hello! Ive had a large problem with SDL\_image on windows mingw32 (VSCode). Ive recntly installed the latest version (along with SDL itself of course).Ive put the SDL\_image.h in my project’s includes, and the SDL\_image.a in the same folder as the SDL2.a and SDL2main.a, that I link when compiling as follows:

gcc -o testImage.exe -IC:\i686-w64-mingw32\include -LC:\i686-w64-mingw32\lib src/testImage.c -lSDL2 -lSDL2\_image

In the same folder as my exe, I have : SDL2.dll, SDL2\_image.dll and libpng16\_16.dll. When I compile and run a program that uses just SDL, it works perfectly fine.

Now when I run this program: [imageTEst.c - Pastebin.com](https://pastebin.com/wGvsHMxC) , it compiles without errors. But on execution, The window appears for a quarter of second before dissapearing. As you can see, I have a file that I keep for logs, wich gives me this message:

error creating surface: Failed loading libpng16-16.dll: Specified procedure is unfindable

Ive linked a screenshot of my project structure, and as you can see, the libpng16\_16.dll is indeed in the same folder as my exe. Im quite lost and Ive tried many different ways to solve this. Please help!

 ![image](https://discourse.libsdl.org/uploads/default/original/2X/d/dc625753d10c83dc0943755ad59237f169bff477.png)

---

<div class="post-metadata">

**Author:** ![meklu](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/meklu/32/2564_2.png) [@meklu](https://discourse.libsdl.org/u/meklu)\
**Post date:** [January 1, 2022, 8:03am UTC](https://discourse.libsdl.org/t/sdl-image-problems/34239/2 "2022-01-01T08:03:12Z")

</div>

I’m not a Windows expert but I think your libpng DLL was probably compiled with MSVC, as opposed to your project which was all mingw judging by your post. Unfortunately I think I recall MSVC and mingw not mixing all too well on Windows. You could try sourcing a mingw version of `libpng16-16.dll` or compiling it yourself.
