Original Post
I have been trying to get started with SDL, I have set up my code and can't seem to find out what's wrong.
Here is my source code:
#include
#include
#include
int main( int argc, char* args[] )
{
//The images
SDL_Surface* hello = NULL;
SDL_Surface* screen = NULL;
SDL_Init(SDL_INIT_VIDEO);
screen = SDL_SetVideoMode(640,480,16, SDL_HWSURFACE|SDL_DOUBLEBUF);
hello= SDL_LoadBMP("riku.bmp");
SDL_BlitSurface(hello,NULL,screen,NULL);
SDL_Flip(screen);
SDL_Delay(2000);
SDL_FreeSurface(hello);
SDL_Quit();
return 0;
}
The errors I get are:
\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to
\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to
\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to
\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to
\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to `SDL_strlcpy'|
||=== Build finished: 9 errors, 0 warnings ===|
I don't know what is wrong with the code, could someone please help me?
I am using the latest versions of SDL and mingw, I have mingw32, SDL, and SDLmain libraries linked, and I am using the code::blocks IDE.
Here is my source code:
#include
#include
#include
int main( int argc, char* args[] )
{
//The images
SDL_Surface* hello = NULL;
SDL_Surface* screen = NULL;
SDL_Init(SDL_INIT_VIDEO);
screen = SDL_SetVideoMode(640,480,16, SDL_HWSURFACE|SDL_DOUBLEBUF);
hello= SDL_LoadBMP("riku.bmp");
SDL_BlitSurface(hello,NULL,screen,NULL);
SDL_Flip(screen);
SDL_Delay(2000);
SDL_FreeSurface(hello);
SDL_Quit();
return 0;
}
The errors I get are:
\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to
SDL_strlcpy'|
\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to SDL_strlcat'|\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to
SDL_strlcpy'|
\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to SDL_strlcat'|\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to
SDL_strlcpy'|
\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to SDL_GetError'|\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to
SDL_SetModuleHandle'|
\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to SDL_getenv'|\mingw\lib\libSDLmain.a(SDL_win32_main.o):SDL_win32_main.c|| undefined reference to `SDL_strlcpy'|
||=== Build finished: 9 errors, 0 warnings ===|
I don't know what is wrong with the code, could someone please help me?
I am using the latest versions of SDL and mingw, I have mingw32, SDL, and SDLmain libraries linked, and I am using the code::blocks IDE.