I have tried to use SDL_image:
so I have copied the
SDL_image.h to PellesC include directory
*.dll form SDL_image-1.2.10-win32.zip to bin directory
all dll have transformed to lib with polib (i.e. polib SDL_image.dll /OUT:SDL_image )
and have copied *.lib to PellesC lib directory
Then tried to build :
#include <SDL.h>
#include <SDL_image.h>
#include <windows.h>
#include <stdbool.h>
SDL_Surface *buffer = 0;
SDL_Surface *bitmap = 0;
int wmain(int argc, char *argv[])
{
SDL_Init(SDL_INIT_VIDEO);
IMG_Init(IMG_INIT_JPG);
buffer = SDL_SetVideoMode(1280, 1024, 32, SDL_SWSURFACE|SDL_ANYFORMAT);
bool run = true;
SDL_Event event;
bitmap = IMG_Load("test.jpg");
SDL_BlitSurface(bitmap, 0, buffer, 0);
SDL_UpdateRect(buffer, 0, 0, bitmap->w, bitmap->h);
SDL_Flip(buffer);
SDL_SaveBMP(bitmap,"test2.bmp");
if(bitmap == 0){
return -1;
}
while(run){
while(SDL_PollEvent(&event)){
if(event.type == SDL_QUIT)
{
run = false;
}
}
}
SDL_Quit();
return(0);
}
but the result was :
POLINK: error: Unresolved external symbol '_IMG_Init'.
POLINK: error: Unresolved external symbol '_IMG_Load'.
POLINK: fatal error: 2 unresolved external(s).
Can anybody help?