My codeblocks isn't finding the SDL2main and SDL2.dll files. Note that I added path and the compiler auto detected the include and lib library correctly . I also moved the SDL2.dll file to both System32 and SystemWOW64 file . The one I am using is i686-w64-mingw32 file. Processor is Intel Pentinum E5800 and the os is Windows 7 Ultimate 64 bit OS . The code I am trying to run is below -
#include<iostream>
#include<SDL2/SDL.h>
int main()
{
if(SDL_Init(SDL_INIT_VIDEO)<0)
{
std::cerr<<SDL_GetError();
return -1;
}
SDL_Window* window=SDL_CreateWindow("",0,0,240,240,SDL_WINDOW_SHOWN);
if(window)
{
std::cout<<"Window was created\n";
SDL_DestroyWindow(window);
}
else
{
std::cerr<<SDL_GetError();
}
SDL_Quit();
return 0;
}
The debugger said : ld.exe - ld didn't find -lSDL2main
ld.exe - ld didn't find -lSDL2.dll
ld is quiting with return value 1
Where is the problem ?