Hi there,
I was using my parents’ Mac today and trying to compile my
(supposedly) portable application to MacOS X and encountered some
problems. The problem is specifically that when making SDL_image, it
complains at one point about:
IMG_png.c:70:17: error: png.h: No such file or directory
And of course, this is just the begining of 10 thousand other similar errors.
Lemme explain how I built my programming environment. First, using
MacOSX, build target is : powerpc-apple-darwin8. Using Xcode and a
terminal to do all the work. Now, I’ve successfully compiled zlib, by
doing make
and then copying files *.h into $C/include and copying
libz.a (if i remember right) into $C/lib ($C is short for my
installation directory). Then compiled libPNG with the darwin
makefile, changing install directories and where zlib is to be found
in the header of the makefile, worked fine and installed in $C/ as
well.
libZ and libPNG are now installed correctly (I guess… I hope, I’ve
been doing this for the past couple years!)
Now trying to install libSDL: ./configure --prefix=$C ; make ;
make install (no need of sudo as I am owner of install dir) and it
compiles fine, no trouble and installs fine as well.
Now trying to install libSDL_net: ./configure --prefix=$C ; make
; make install … Finds libSDL fine and compiles perfect, installs
with no complaint.
Then tries to install libSDL_image. Note that both libZ and libPNG
were installed in the respective $C/include and $C/lib, they are
there, I can see them. Running ./configure --prefix=$C gives no
trouble, actually I can see the lines:
checking for sdl-config…
/Users/simon/Desktop/compilation/usr_local.darwin/bin/sdl-config
checking for SDL - version >= 1.2.10… yes
checking for uncompress in -lz… yes
checking for jpeg_CreateDecompress in -ljpeg… no
configure: WARNING: *** Unable to find JPEG library (http://www.ijg.org/)
configure: WARNING: JPG image loading disabled
checking for png_create_read_struct in -lpng… yes
checking for TIFFClientOpen in -ltiff… no
configure: WARNING: *** Unable to find Tiff library
(http://www.remotesensing.org/libtiff/)
configure: WARNING: TIF image loading disabled
configure: creating ./config.status
Note the line that says “-lpng… yes”
Now trying: make
And i get after some time:
[…]
if /bin/sh ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=""
-DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING=""
-DPACKAGE_BUGREPORT="" -DPACKAGE=“SDL_image” -DVERSION=“1.2.5”
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
-DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLOAD_PNG=1 -DLOAD_BMP=1
-DLOAD_GIF=1 -DLOAD_LBM=1 -DLOAD_PCX=1 -DLOAD_PNM=1 -DLOAD_TGA=1
-DLOAD_XCF=1 -DLOAD_XPM=1 -DLOAD_XV=1 -I. -I. -g -O2
-I/Users/simon/Desktop/compilation/usr_local.darwin/include/SDL
-D_GNU_SOURCE=1 -D_THREAD_SAFE -MT IMG_png.lo -MD -MP -MF
".deps/IMG_png.Tpo" -c -o IMG_png.lo IMG_png.c;
then mv -f “.deps/IMG_png.Tpo” “.deps/IMG_png.Plo”; else rm -f
".deps/IMG_png.Tpo"; exit 1; fi
gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION=""
-DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DPACKAGE=“SDL_image”
-DVERSION=“1.2.5” -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLOAD_PNG=1
-DLOAD_BMP=1 -DLOAD_GIF=1 -DLOAD_LBM=1 -DLOAD_PCX=1 -DLOAD_PNM=1
-DLOAD_TGA=1 -DLOAD_XCF=1 -DLOAD_XPM=1 -DLOAD_XV=1 -I. -I. -g -O2
-I/Users/simon/Desktop/compilation/usr_local.darwin/include/SDL
-D_GNU_SOURCE=1 -D_THREAD_SAFE -MT IMG_png.lo -MD -MP -MF
.deps/IMG_png.Tpo -c IMG_png.c -fno-common -DPIC -o .libs/IMG_png.o
IMG_png.c:70:17: error: png.h: No such file or directory
Self explanatory, but I noticed this:
"-I/Users/simon/Desktop/compilation/usr_local.darwin/include/SDL"…
It never says the same without the “/SDL” at the end which is required
to find png.h and possibly other header files.
I haven’t found a way to work around this and I don’t own a mac
myself, so I wont be able to experiment past this sunday, probably
only in a week or two…
So I’m stuck at this point, and could not finish this installation,
SDL_image is now the only library that needs to be compiled so I can
finally see if my application is fully Linux/Windows/MacOSX
compatible!
Thanks for all help in advance,
Simon