I'm trying to draw a png image to a window using the SDL_image extension, but it gives me an "Entry Point Not Found" error
I'm using SDL (2.0.9) and SDL_Image (2.0.5) I've copied the following bin files to the executable directory
main.cpp extract
#include <iostream>
#include <SDL.h>
#include <SDL_image.h>
int main( int argc, char* args[] )
{
SDL_Texture* test_tex;
SDL_Window* window = NULL;
SDL_Renderer* renderer;
if(renderer)
{
//Tested blank screen and it works
/*
SDL_RenderPresent(renderer);
SDL_Delay(2000);
*/
//Trying to use SDL_image and it fails
SDL_Surface *tmp_surface = IMG_Load("player.png");
test_tex = SDL_CreateTextureFromSurface(renderer,tmp_surface);
SDL_FreeSurface(tmp_surface);
SDL_RenderPresent(renderer);
SDL_Delay(2000);
}
...
Complied like this
g++ test.cpp ^
-IC:\dev\SDL2-2.0.9\i686-w64-mingw32\include\SDL2 ^
-IC:\dev\SDL2_image-2.0.5\i686-w64-mingw32\include\SDL2 ^
-LC:\dev\SDL2-2.0.9\i686-w64-mingw32\lib ^
-LC:\dev\SDL2_image-2.0.5\i686-w64-mingw32\lib ^
-lmingw32 ^
-lSDL2main ^
-lSDL2 ^
-lSDL2_image ^
-o test
I've tested the window with a blank renderer and it's all ok, It fails when I add the call to IMG_Load
You need another SDL_Image version. Use SDL_Image (2.0.4) instead of (2.0.5).
You can get the older versions here:
https://www.libsdl.org/projects/SDL_image/release/?C=M;O=D
(That fixed the same problem for me)
The 2.0.9 32 bit SDL2.dll gave me issues with anything other than VC++. Fortunately the 2.0.10 version is available for testing which actually works for my Code::Blocks compiled tests: https://www.libsdl.org/tmp/download-2.0.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With