I will reproduce here the steps to configure SDL2.0.3 library for Netbeans with MinGW in an intel i7 (x86_64 architecture) and Windows 7 64 bit SP1. I will assume you have downloaded already the neccesary packages (netbeans, mingw x86_64 and SDL 2.0.3) and know how to configure environment variables. If you don’t just google “windows 7 set environment variables” and follow instructions; it’s an easy and straightforward process.
- Install Netbeans (C/C++ version) from scratch. I installed stable version 7.4
- Install MinGW x86_64 version. The path where it was installed will be henceforth called %MINGWPATH%”
- Uncompress SDL tar file to %SDLPATH%
- Add “%MINGWPATH%/msys/1.0/bin” and “%MINGWPATH%/bin” to the PATH environment variable.
- Start netbeans; it should automatically detect your mingw tool collection. If it doesn’t, go to tools -> Options -> c/c++ -> build tools tab and click on add collection. Select the /bin folder of the %MINGWPATH% as the base directory, and %MINGWPATH%/msys/1.0/bin for the make.exe if it’s not automatically selected.
- Now create a new project and create a c++ application.
- In Project properties -> c++ compiler -> include directories and headers -> add folder %SDLPATH%/x86_64-w64-mingw32/bin
- Do not close the window; on the Linker section add %SDLPATH%/x86_64-w64-mingw32/lib to “additional library directories”.
- Finally, add these libraries in this order: mingw32.a, SDL2main.a, SDL2.a. The first file can be found on the %MINGWPATH%/x86_64-w64-mingw32/lib and the other two in the %SDLPATH%/x86_64-w64-mingw32/lib.