Hi guys I'm using codeblocks with a 64 bit gcc-mingw compiler
I downloaded the SDL dev libraries and linked it, this has always worked for me in the past the only difference is I'm using a 64 bit version of codeblocks rather than a 32 bit version
here are the steps I took, firstly I moved the SDL include directory into the compilers include directory, I also moved the lib files (.a) files into the lib folder of the compiler, and included the SDL2.dll into the same directory as the codeblocks.exe file
now what I did to link the libraries
I added libSDL2main.a and libSDL2.dll.a in the linker settings under build options, I also specified the following flags -lmingw32 -lSDL2main -lSDL2
I even added the lib folder in the search directory of the linker ( normally I can get away without doing this ) but everything fails to link, the linker gives me the following errors
ld.exe||cannot find -lSDL2main
ld.exe||cannot find -lSDL2
1 2 3 4 5 6 7 8 9 10 11 12
|
#include <iostream>
#include <SDL2/SDL.h>
using namespace std;
int SDL_main(int argc,char* argv[])
{
cout << "Hello world!" << endl;
return 0;
}
|