I want a good explanation how to get it started, i always get the
undefined reference eroor but i dont understand what the stuff with
sdl-config --libs says! i’m using windows, not linux!
I don?t know exactly, what problems you have.
Ok, I?ll explain it in detail.
I presume you have downloaded the mingw32 development runtime for
from http://www.libsdl.org/download-1.2.html .
If you have extracted *.tar.gz archive, you have a new folder called
Within that folder, there is a file called i386-mingw32msvc.tar.gz.
Copy that to your mingw32 folder ( normally C:\gcc-2.95.2 ).
There should be a folder called i386-mingw32msvc.
If you extract the file i386-mingw32msvc.tar.gz into your mingw32
your SDL headers are now within
your SDL library files in c:\gcc-2.95.2\i386-mingw32msvc\lib and the
sdl-config script in c:\gcc-2.95.2\i386-mingw32msvc\bin.
You should edit the sdl-config file.
Find the line which looks like that ( normally line 3 ):
and change it to
If you have installed mingw32 to another folder, change
"gcc-2.95.2" to the location of that folder.
Now, you can execute sdl-config [args] and get the results.
args = --libs : the libraries needed by SDL
args = --cflags : the SDL compiler flags
You must use these outputs to compile your file.
For example: gcc -o test test.c
sdl-config --cflags --libs
For more information about using sdl-config,
have a look at ( even if you use windows ):
I hope this helps