I?m new on this, I?m only a game designer and i need something to play around
with, so I decided to try SDL. I have little knowledge in setting up stuff
like this. (sorry)
Should i write:
gcc kurt.cpp -o kurt.exe -lmingw32 -lSDLmain -lSDL -mwindow ?
and the sdl-config --cflags should it be there to ?
Sorry I?m a new on this.
Sam Lantinga wrote:> > How do i compile SDL with mingw32.
I can compile a cpp file only using mingw32 but now i have added the SDL
and i did follow the install instructions.
this is how i compile without SDL
gcc kurt.cpp -o kurt.exe
should there be a -lSDL after it ?
or something with the SDL.dll ?
Link the output of sdl-config --libs
On my Mingw32 setup:
-lmingw32 -lSDLmain -lSDL -mwindow
Also use the output of “sdl-config --cflags” when compiling the source.
See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software
Unpacked the i386-mingw32msvc.tar.gz file in
C:\gcc-2.95.2 , Copy SDL.dll from i386-mingw32msvc/lib/ and include it
with your
application, in the directory where your executable resides.
This is in my Autoexec.bat
set PATH=c:\gcc-2.95.2\bin;%PATH%
GCC.EXE: $: no such file or directory
GCC.EXE: (sld-config: no such file or directory
cc1plus.exe: Invlid option -fclags
cc1plus.exe: Invlid option -flibs
This is in my Autoexec.bat
set PATH=c:\gcc-2.95.2\bin;%PATH%
I can compile a *.cpp with
gcc kurt.cpp -o a.exe
Then:
Unpacked the i386-mingw32msvc.tar.gz file in
C:\gcc-2.95.2 , Copy SDL.dll from i386-mingw32msvc/lib/ and include it
with your
application, in the directory where your executable resides.
GCC.EXE: $: no such file or directory
GCC.EXE: (sld-config: no such file or directory
cc1plus.exe: Invlid option -fclags
cc1plus.exe: Invlid option -flibs
GCC.EXE: $: no such file or directory
GCC.EXE: (sld-config: no such file or directory
cc1plus.exe: Invlid option -fclags
cc1plus.exe: Invlid option -flibs
/GrooFu
Are you using the DOS shell to enter the above line or the cygnus port of
bash? DOS won;t understand the $(…) construct (and actually a lot of
other shells won;t either - i got attacked for doing it like that on this
mailing list in the past. the prefered way it to use ...)
Ahh, there’s your problem. You need to run the mingw32.bat file that
is included in the gcc-2.95.2 directory that you get when you unpack
the mingw32 tools available from: http://www.libsdl.org/Xmingw32/
This will launch the bash shell which is similar to, but not exactly
the same as the DOS shell. The biggest difference you’ll see immediately
is that you must use ‘/’ instead of ‘’ as the directory separator.
See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software