Some instructions to install SDL, SDL_image, SDL_mixer and SDL_net under cygwin/mingw

Hello.

I need some Instructions to get SDL, SDL_image, SDL_mixer and SDL_net
work under Windows, with some gcc-environment. But under both, Cygwin
and MSYS (mingw32) i have problems:

Under Cygwin:
I can install SDL correctly. My Programs run.

SDL_mixer seems to install correctly, but no sounds are Played.

SDL_image doesnt install, because it cannot find the png.h-file, if i
turn off jpeg and tiff-support. If i turn on jpeg-support, it doesnt
find the jpeg.h or something. Trying to change the include-Path in the
Makefile manually, i get strange Error-Messages like

$ make
/bin/sh ./libtool --tag=CC --mode=link gcc -g -O2
-I/usr/local/include/SDL -I/usr/include/mingw -mno-cygwin
-Dmain=SDL_main -o libSDL_image.la -rpath /usr/local/lib
-no-undefined -release 1.2 -version-info 1:4:1 IMG.lo IMG_bmp.lo
IMG_gif.lo IMG_jpg.lo IMG_lbm.lo IMG_pcx.lo IMG_png.lo IMG_pnm.lo
IMG_tga.lo IMG_tif.lo IMG_xcf.lo IMG_xpm.lo IMG_xv.lo
-L/usr/local/lib -lmingw32 -lSDLmain -lSDL -mno-cygwin -mwindows
rm -fr .libs/libSDL_image.dll.a
gcc -shared .libs/IMG.o .libs/IMG_bmp.o .libs/IMG_gif.o
.libs/IMG_jpg.o .libs/IMG_lbm.o .libs/IMG_pcx.o .libs/IMG_png.o
.libs/IMG_pnm.o .libs/IMG_tga.o .libs/IMG_tif.o .libs/IMG_xcf.o
.libs/IMG_xpm.o .libs/IMG_xv.o -L/usr/local/lib -lmingw32 -lSDLmain
/usr/local/lib/libSDL.dll.a -L/usr/lib -mno-cygwin -mno-cygwin
-mwindows -o .libs/SDL_image.dll -Wl,–enable-auto-image-base -Xlinker
–out-implib -Xlinker .libs/libSDL_image.dll.a
.libs/IMG_pnm.o: In function ReadNumber': /usr/include/mingw/ctype.h:158: undefined reference to__imp___pctype_dll’
/usr/include/mingw/ctype.h:158: undefined reference to __imp____mb_cur_max_dll' /usr/include/mingw/ctype.h:153: undefined reference to__imp___pctype_dll’
/usr/include/mingw/ctype.h:153: undefined reference to __imp____mb_cur_max_dll' .libs/IMG_xpm.o: In functionload_xpm’:
/usr/include/mingw/ctype.h:158: undefined reference to __imp____mb_cur_max_dll' /usr/include/mingw/ctype.h:158: undefined reference to__imp___pctype_dll’
.libs/IMG_xpm.o: In function load_xpm': /home/christoph/sdl_image/SDL_image-1.2.5/IMG_xpm.c:397: undefined reference to__imp____mb_cur_max_dll’
.libs/IMG_xpm.o: In function load_xpm': /usr/include/mingw/ctype.h:158: undefined reference to__imp___pctype_dll’
/usr/include/mingw/ctype.h:158: undefined reference to __imp____mb_cur_max_dll' /usr/include/mingw/ctype.h:158: undefined reference to__imp___pctype_dll’
/usr/include/mingw/ctype.h:158: undefined reference to __imp____mb_cur_max_dll' /usr/include/mingw/ctype.h:158: undefined reference to__imp___pctype_dll’
/usr/include/mingw/ctype.h:158: undefined reference to `__imp____mb_cur_max_dll’
Creating library file: .libs/libSDL_image.dll.a
collect2: ld returned 1 exit status
make: *** [libSDL_image.la] Fehler 1

Under MSYS:
SDL seems to be installed correctly… SDL_mixer doesnt… Programs
compiled with SDL_mixer-use are crashing my System, but
install-instructions dont tell anything about MinGW32…
I compiled the JPEG-Library using ./configure; make; make test; make
install… (as the readme sayed). It ran correctly, and i thoght it
wold be installed correctly. But the SDL_image-Configure-Script didnt
find the jpeg-library.
I compiled zlib and installed it. But trying to compile pnglib, it
also tells me that zlib is not found. Using makefile.mingw doesnt
solve the problem. I get the same error-messages. Changing the Paths
manually seemed to make it compile, but trying to install it, the
makefile produced an endless loop repeatingly telling

make[5]: Entering directory /home/christoph/installers/LIBPNG/libpng-1.2.14' makefile:45: You haven't specified a 'prefix=' location. Defaulting to "/usr" make[5]: *** No rule to make targetcheck’. Stop.
make[5]: Leaving directory /home/christoph/installers/LIBPNG/libpng-1.2.14' make[5]: Entering directory/home/christoph/installers/LIBPNG/libpng-1.2.14’
makefile:45: You haven’t specified a ‘prefix=’ location. Defaulting to "/usr"
install -m 644 ./png.h ./pngconf.h /usr/include/libpng12
./install: Installing: command not found
./install: On: command not found

(while the number - here 5 - is increasing… which tells me its an
endless loop).

I am sure I did something wrong, but I dont know, what. Under cygwin,
it should work in that way - nothing else is said.

Please help me.

Thanks a lot.

Hi,

tknits kitsahcots wrote:

Hello.
I need some Instructions to get SDL, SDL_image, SDL_mixer and SDL_net
work under Windows, with some gcc-environment. But under both, Cygwin
and MSYS (mingw32) i have problems:
[snip snip]

Under MSYS:
SDL seems to be installed correctly… SDL_mixer doesnt… Programs
compiled with SDL_mixer-use are crashing my System, but
install-instructions dont tell anything about MinGW32…
[snip snip]

I know only MinGW/MSYS…

“Seems” sounds like guessing… Better compile and run the SDL
test programs to see if SDL works properly, and only then install
the other libraries. Building the tests exercises the configure
build method, then grab a small demo and try the direct-Makefile
build method. If both build methods work, you can be reasonably
sure your SDL dev setup is solid.

If you don’t really need to build from sources, do consider taking
the easy route of grabbing developer’s packages. Installing
SDL_{image|mixer|net|ttf} using libsdl.org’s mingw developer’s
packages is dead easy, just a few library and header files. I’ve
[re]set-up my mingw/msys dev environment a few times, and the
SDL_* developer’s packages are very easy to install and are
trouble-free.–
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Hi.

I know only MinGW/MSYS…
Enough for me.

“Seems” sounds like guessing… Better compile and run the SDL
test programs to see if SDL works properly, and only then install
the other libraries.
Building the tests exercises the configure
build method, then grab a small demo and try the direct-Makefile
build method. If both build methods work, you can be reasonably
sure your SDL dev setup is solid.
No Program crashes and Sound and Music seems to work.
I think SDL is correctly installed.

If you don’t really need to build from sources, do consider taking
the easy route of grabbing developer’s packages. Installing
SDL_{image|mixer|net|ttf} using libsdl.org’s mingw developer’s
packages is dead easy, just a few library and header files. I’ve
[re]set-up my mingw/msys dev environment a few times, and the
SDL_* developer’s packages are very easy to install and are
trouble-free.
I dont need to build from source (though i would like to). But i chose
the way because i thought it was simpler. There are no real
Installation-Instructions in the binary tarball, i.e., where to put
the include- and libfiles, to use them with MSYS. I am completely
missing any instruction, couldnt find any. Just putting them in the
same directory as my Source is not good - for example if I want to
build a Game or whatever using a Makefile.

So where do i have to put them to get compiling work under msys?

Thank You.

christoph.senjak at web.de wrote:

[snip]

If you don’t really need to build from sources, do consider taking
the easy route of grabbing developer’s packages. Installing
SDL_{image|mixer|net|ttf} using libsdl.org’s mingw developer’s
packages is dead easy, just a few library and header files. I’ve
[re]set-up my mingw/msys dev environment a few times, and the
SDL_* developer’s packages are very easy to install and are
trouble-free.
I dont need to build from source (though i would like to). But i chose
the way because i thought it was simpler. There are no real
Installation-Instructions in the binary tarball, i.e., where to put
the include- and libfiles, to use them with MSYS. I am completely
missing any instruction, couldnt find any. Just putting them in the
same directory as my Source is not good - for example if I want to
build a Game or whatever using a Makefile.

Building from source is nice if one is willing to invest the time,
but on Win32, getting all the dependencies right (for zlib, jpeg,
png, etc. etc.) is something I’d rather avoid. The dev package is
easier to maintain for me.

This manual method worked well for me:
(1) Put header file in the SDL header file directory,
c:\msys\1.0\include\SDL (or equivalent) a.k.a. /usr/include/SDL,
because sdl-config includes this directory in the search.
(2) Put libraries in c:\msys\1.0\lib (or equivalent) a.k.a.
/usr/lib, that should already be in the lib search path for gcc.
Keep the DLL there as well, for copying over to the executable
directory.–
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Hi.

This manual method worked well for me:
(1) Put header file in the SDL header file directory,
c:\msys\1.0\include\SDL (or equivalent) a.k.a. /usr/include/SDL,
because sdl-config includes this directory in the search.
(2) Put libraries in c:\msys\1.0\lib (or equivalent) a.k.a.
/usr/lib, that should already be in the lib search path for gcc.
Keep the DLL there as well, for copying over to the executable
directory.

Well. Thanks. But this doesnt work for me, unfortunately.

Maybe Building from source would be the best… But i cannot compile
libpng on MinGW, and on Cygwin, it cannot find the png.h/jpeg.h-files
and if i show them it cannot link against.

Why isnt there any MinGw32-Specific installer, or why doesnt the
Install-Script work on Cygwin?

Hi,

christoph.senjak at web.de wrote:

Hi.

This manual method worked well for me:
(1) Put header file in the SDL header file directory,
c:\msys\1.0\include\SDL (or equivalent) a.k.a. /usr/include/SDL,
because sdl-config includes this directory in the search.
(2) Put libraries in c:\msys\1.0\lib (or equivalent) a.k.a.
/usr/lib, that should already be in the lib search path for gcc.
Keep the DLL there as well, for copying over to the executable
directory.

Well. Thanks. But this doesnt work for me, unfortunately.

This is very unusual. Can you provide specifics? If you see my
instructions above, it doesn’t get any easier than that.

My suggestions:
(a) Check whether you have copied the appropriate DLLs into the
same directory as your executable, in order to run the program.
(b) Check that sdl-config includes /usr/include/SDL in the search
path, by running it as “sdl-config --cflags”.
© Run “gcc -print-search-dirs” and see that you have /usr/lib/
in the library path. You can try checking the output of
"sdl-config --libs" as well, but /usr/lib/ is a standard library path.

That’s all I can do unless you provide the list with more information.

Maybe Building from source would be the best… But i cannot compile
libpng on MinGW, and on Cygwin, it cannot find the png.h/jpeg.h-files
and if i show them it cannot link against.

But you have spent a lot of time on it without complete success,
while I have set up those libraries using the MinGW developer’s
package in less than 5 minutes… :slight_smile: So logically…

Why isnt there any MinGw32-Specific installer, or why doesnt the
Install-Script work on Cygwin?

Because I guess installation involves copying a couple of files to
a couple of places. This, in theory, should be dead easy and
trouble-free.

If you have run into errors, posting the output details to the
list ought to help with diagnosis.

HTH,–
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Hello,
I am attempting to build a game that uses SDL (including SDL_Mixer,
SDL_net and SDL_ttf). My development environment is cygwin. My goal is to
improve the AI of the game so I simply need it to compile and run. I am
willing to do the work of using the source to build the libraries. I have
had no problems with SDL itself and SDL_net. I need to get freetype
installed to make SDL_ttf work. I ran into an error message that does not
make sense while attempting to get SDL_Mixer to compile. This lead me to
this conversation on the list. The error states that the C compiler cannot
create executables
. This is obviously not true. Here is what I did and
the response I got:

pohara at Guinness /tmp/SDL_mixer-1.2.7
$ ./autogen.sh
Generating build information using autoconf
This may take a while …
Now you are ready to run ./configure

pohara at Guinness /tmp/SDL_mixer-1.2.7
$ ./configure
checking build system type… i686-pc-cygwin
checking host system type… i686-pc-cygwin
checking for gcc… gcc
checking for C compiler default output file name…
configure: error: C compiler cannot create executables
See `config.log’ for more details.

pohara at Guinness /tmp/SDL_mixer-1.2.7
$ sdl-config --cflags
-I/usr/local/include/SDL -I/usr/include/mingw -mno-cygwin -Dmain=SDL_main

I am wondering if there is a list of dependencies for SDL_Mixer someplace so
I can verify that they are present? Also if any of you have seen this error
and know what it is really all about?–
Tanks for your Support
Pat O’Hara


/== /== /*==

One question, did you compile the others from source? I think I’ve gotten
that message before when I forgot the compiler.or make.On 2/15/07, Patrick O’Hara wrote:

Hello,
I am attempting to build a game that uses SDL (including SDL_Mixer,
SDL_net and SDL_ttf). My development environment is cygwin. My goal is to
improve the AI of the game so I simply need it to compile and run. I am
willing to do the work of using the source to build the libraries. I have
had no problems with SDL itself and SDL_net. I need to get freetype
installed to make SDL_ttf work. I ran into an error message that does not
make sense while attempting to get SDL_Mixer to compile. This lead me to
this conversation on the list. The error states that the C compiler
cannot create executables
. This is obviously not true. Here is what I
did and the response I got:

pohara at Guinness /tmp/SDL_mixer-1.2.7
$ ./autogen.sh
Generating build information using autoconf
This may take a while …
Now you are ready to run ./configure

pohara at Guinness /tmp/SDL_mixer-1.2.7
$ ./configure
checking build system type… i686-pc-cygwin
checking host system type… i686-pc-cygwin
checking for gcc… gcc
checking for C compiler default output file name…
configure: error: C compiler cannot create executables
See `config.log’ for more details.

pohara at Guinness /tmp/SDL_mixer-1.2.7
$ sdl-config --cflags
-I/usr/local/include/SDL -I/usr/include/mingw -mno-cygwin -Dmain=SDL_main

I am wondering if there is a list of dependencies for SDL_Mixer someplace
so I can verify that they are present? Also if any of you have seen this
error and know what it is really all about?

Patrick O’Hara wrote:

[snip] Here is what I did and the response I got:

pohara at Guinness <mailto:pohara at Guinness> /tmp/SDL_mixer-1.2.7
[snip]
pohara at Guinness <mailto:pohara at Guinness> /tmp/SDL_mixer-1.2.7
$ ./configure
checking build system type… i686-pc-cygwin
checking host system type… i686-pc-cygwin
checking for gcc… gcc
checking for C compiler default output file name…
configure: error: C compiler cannot create executables
See `config.log’ for more details.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The above is definitely good advice. Please try to use
config.log to diagnose the problem (it’s very verbose and you
should be able to see and study the failed compile attempt),
failing which, I suppose you can post config.log to the list for
list members to study and help if they can.

HTH,–
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia