I set up Eclipse Luna, MinGW, SDL, openGL for windows7 64bit.
These are some scribbles that for me are important for future use.
Eclipse Luna
install JDK if needed after that just inzip the files and the executable of eclipse works.
MinGW
Download the installer and follow these steps:
https://www.ics.uci.edu/~pattis/common/handouts/mingweclipse/mingweclipse.html
important
- install the mingw32-base, mingw32-gc-g++, msys-base package
- Add the 'Path' enviroment (capital 'P' lower case 'ath') variable in system with needed directories
C:\MinGW\bin;C:\MinGW\msys\1.0\bin;
SDL2
download the minggw.tar.gz from the SDL2 downloads.
It is important that you use the minggw version.
I made this mistake and tried 5 hours to get SDL working, in which I failed (I got a lot of WinMain@32 errors because of this)
It is important that you use the minggw version.
I made this mistake and tried 5 hours to get SDL working, in which I failed (I got a lot of WinMain@32 errors because of this)
Unzip it at a location of choice.
Eclipse Luna project
Create 'Empty Project' using the 'MinGW GCC' toolchain.
Go to project settings
in 'C/C++ Build -> Settings' add following as linker flags :
-mwindows -static-libgcc -static-libstdc++
from what I understood -mwindows since we are working on windows platform to resolve WinMain problems
-static-libgcc -static-libstdc++ are for embedding gcc in your executable
'C/C++General -> Paths and Symbols -> Includes -> GNU C++' addn the 'include' directory of SDL.
'C/C++General -> Paths and Symbols -> Libraries' add 'mingw32', 'sdl2main', 'sdl2'.
'C/C++General -> Paths and Symbols -> Library Paths' add the 'lib' directory of SDL.
This way your Tool Chain will have access to all SDL2 information
You will have to include SDL as following :
#include "SDL2/SDL.h"
OpenGL
In 'C/C++ General > Paths and Symbols > Libraries' add folowing items:
'opengl32' and 'glu32'
'opengl32' and 'glu32'