iPhone SDL_image not working

Hey All,
I have been working on porting a game for Mac using SDL 1.2 to the iPhone
using SDL 1.3. All seems to going more smoothly than I had anticipated. I am
now trying to get png images loaded. Has anyone written anything yet to load
png files? I found and downloaded the latest SDL_image library, because it
stated that it works for the iPhone. I compiled the static library and
brought it into my project. When I try building it, I get a "SDL_image.h"
does exist error. I tried changing it to “SDL_image/SDL_image.h” and get the
same error.

I went back to rebuild the SDL_image and thought I would try again. Just for
kicks, I went into the IMG_png.c and insert an error. Actually I removed a
semi-colon. I did a build and was shocked to see that there were no errors
and the build was successful. So I did a clean and build and got the same
successful build.

So I am now totally dumb-struck. How can a project build with obvious errors
in it? But more importantly, does anyone have a working library to load png
images for the iPhone?
Thanks in advance.
Rick

You have to add the path where SDL_image.h is installed in the headers
section of your project.

Open project preferences, find the Heades Search Paths and add the path
there.

I haven’t gotten latest sldimage working because of an unknown bug, can you
tell us if it works for you?

Vittorio

Samuel Goldwynhttp://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html

  • "I’m willing to admit that I may not always be right, but I am never
    wrong."On Sat, Feb 6, 2010 at 5:46 PM, Rick Page wrote:

Hey All,
I have been working on porting a game for Mac using SDL 1.2 to the iPhone
using SDL 1.3. All seems to going more smoothly than I had anticipated. I am
now trying to get png images loaded. Has anyone written anything yet to load
png files? I found and downloaded the latest SDL_image library, because it
stated that it works for the iPhone. I compiled the static library and
brought it into my project. When I try building it, I get a "SDL_image.h"
does exist error. I tried changing it to “SDL_image/SDL_image.h” and get the
same error.

I went back to rebuild the SDL_image and thought I would try again. Just
for kicks, I went into the IMG_png.c and insert an error. Actually I removed
a semi-colon. I did a build and was shocked to see that there were no errors
and the build was successful. So I did a clean and build and got the same
successful build.

So I am now totally dumb-struck. How can a project build with obvious
errors in it? But more importantly, does anyone have a working library to
load png images for the iPhone?
Thanks in advance.
Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks for the info. I forgot to copy the SDL_image.h file over to my
projects include folder.
I am now getting these errors:
"_kUTTypeBMP", referenced from:
_kUTTypeBMP$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeGIF", referenced from:
_kUTTypeGIF$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeICO", referenced from:
_kUTTypeICO$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypePNG", referenced from:
_kUTTypePNG$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeTIFF", referenced from:
_kUTTypeTIFF$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeJPEG", referenced from:
_kUTTypeJPEG$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
ld: symbol(s) not found

I am sure it is something simple. I’ll keep you posted if I get it working.

I did get LodePNG somewhat working. It loaded the image, but the image was
duplicated 4 times on the screen. I’m going to try to get SDL_image working.
RickOn Sun, Feb 7, 2010 at 9:50 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

You have to add the path where SDL_image.h is installed in the headers
section of your project.

Open project preferences, find the Heades Search Paths and add the path
there.

I haven’t gotten latest sldimage working because of an unknown bug, can you
tell us if it works for you?

Vittorio

Samuel Goldwynhttp://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html - “I’m willing to admit that I may not always be right, but I am never
wrong.”

On Sat, Feb 6, 2010 at 5:46 PM, Rick Page <@Rick_Page>wrote:

Hey All,
I have been working on porting a game for Mac using SDL 1.2 to the iPhone
using SDL 1.3. All seems to going more smoothly than I had anticipated. I am
now trying to get png images loaded. Has anyone written anything yet to load
png files? I found and downloaded the latest SDL_image library, because it
stated that it works for the iPhone. I compiled the static library and
brought it into my project. When I try building it, I get a "SDL_image.h"
does exist error. I tried changing it to “SDL_image/SDL_image.h” and get the
same error.

I went back to rebuild the SDL_image and thought I would try again. Just
for kicks, I went into the IMG_png.c and insert an error. Actually I removed
a semi-colon. I did a build and was shocked to see that there were no errors
and the build was successful. So I did a clean and build and got the same
successful build.

So I am now totally dumb-struck. How can a project build with obvious
errors in it? But more importantly, does anyone have a working library to
load png images for the iPhone?
Thanks in advance.
Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

oh you also need to import the framework “MobileServices” to your project to
resolve those symbols
keeps us posted!
Vittorio

Pablo Picassohttp://www.brainyquote.com/quotes/authors/p/pablo_picasso.html

  • "Computers are useless. They can only give you answers."On Mon, Feb 8, 2010 at 4:38 AM, Rick Page wrote:

Thanks for the info. I forgot to copy the SDL_image.h file over to my
projects include folder.
I am now getting these errors:
"_kUTTypeBMP", referenced from:
_kUTTypeBMP$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeGIF", referenced from:
_kUTTypeGIF$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeICO", referenced from:
_kUTTypeICO$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypePNG", referenced from:
_kUTTypePNG$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeTIFF", referenced from:
_kUTTypeTIFF$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeJPEG", referenced from:
_kUTTypeJPEG$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
ld: symbol(s) not found

I am sure it is something simple. I’ll keep you posted if I get it working.

I did get LodePNG somewhat working. It loaded the image, but the image was
duplicated 4 times on the screen. I’m going to try to get SDL_image working.
Rick

On Sun, Feb 7, 2010 at 9:50 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

You have to add the path where SDL_image.h is installed in the headers
section of your project.

Open project preferences, find the Heades Search Paths and add the path
there.

I haven’t gotten latest sldimage working because of an unknown bug, can
you tell us if it works for you?

Vittorio

Samuel Goldwynhttp://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html - “I’m willing to admit that I may not always be right, but I am never
wrong.”

On Sat, Feb 6, 2010 at 5:46 PM, Rick Page wrote:

Hey All,
I have been working on porting a game for Mac using SDL 1.2 to the iPhone
using SDL 1.3. All seems to going more smoothly than I had anticipated. I am
now trying to get png images loaded. Has anyone written anything yet to load
png files? I found and downloaded the latest SDL_image library, because it
stated that it works for the iPhone. I compiled the static library and
brought it into my project. When I try building it, I get a "SDL_image.h"
does exist error. I tried changing it to “SDL_image/SDL_image.h” and get the
same error.

I went back to rebuild the SDL_image and thought I would try again. Just
for kicks, I went into the IMG_png.c and insert an error. Actually I removed
a semi-colon. I did a build and was shocked to see that there were no errors
and the build was successful. So I did a clean and build and got the same
successful build.

So I am now totally dumb-struck. How can a project build with obvious
errors in it? But more importantly, does anyone have a working library to
load png images for the iPhone?
Thanks in advance.
Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks Vittorio.
That’s exactly what I needed. I now have the latest SDL_image from svn
compiled and working with my project. I’ll have to double check, but I think
I had to compile it using the latest stable version of SDL 1.2 and not 1.3.
I tried attaching my SDL and SDL_image libraries for both iPhone 3.1.2 and
Simulator 3.1.2., but forgot about the size limitation of the emails. If
anyone would like them email me directly and I’ll send them.
RickOn Sun, Feb 7, 2010 at 10:11 PM, Vittorio G. <vitto.giova at yahoo.it> wrote:

oh you also need to import the framework “MobileServices” to your project
to resolve those symbols
keeps us posted!
Vittorio

Pablo Picassohttp://www.brainyquote.com/quotes/authors/p/pablo_picasso.html - “Computers are useless. They can only give you answers.”

On Mon, Feb 8, 2010 at 4:38 AM, Rick Page <@Rick_Page>wrote:

Thanks for the info. I forgot to copy the SDL_image.h file over to my
projects include folder.
I am now getting these errors:
"_kUTTypeBMP", referenced from:
_kUTTypeBMP$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeGIF", referenced from:
_kUTTypeGIF$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeICO", referenced from:
_kUTTypeICO$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypePNG", referenced from:
_kUTTypePNG$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeTIFF", referenced from:
_kUTTypeTIFF$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
"_kUTTypeJPEG", referenced from:
_kUTTypeJPEG$non_lazy_ptr in libSDL_image.a(IMG_UIImage.o)
ld: symbol(s) not found

I am sure it is something simple. I’ll keep you posted if I get it
working.

I did get LodePNG somewhat working. It loaded the image, but the image was
duplicated 4 times on the screen. I’m going to try to get SDL_image working.
Rick

On Sun, Feb 7, 2010 at 9:50 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

You have to add the path where SDL_image.h is installed in the headers
section of your project.

Open project preferences, find the Heades Search Paths and add the path
there.

I haven’t gotten latest sldimage working because of an unknown bug, can
you tell us if it works for you?

Vittorio

Samuel Goldwynhttp://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html - “I’m willing to admit that I may not always be right, but I am never
wrong.”

On Sat, Feb 6, 2010 at 5:46 PM, Rick Page <@Rick_Page>wrote:

Hey All,
I have been working on porting a game for Mac using SDL 1.2 to the
iPhone using SDL 1.3. All seems to going more smoothly than I had
anticipated. I am now trying to get png images loaded. Has anyone written
anything yet to load png files? I found and downloaded the latest SDL_image
library, because it stated that it works for the iPhone. I compiled the
static library and brought it into my project. When I try building it, I get
a “SDL_image.h” does exist error. I tried changing it to
"SDL_image/SDL_image.h" and get the same error.

I went back to rebuild the SDL_image and thought I would try again. Just
for kicks, I went into the IMG_png.c and insert an error. Actually I removed
a semi-colon. I did a build and was shocked to see that there were no errors
and the build was successful. So I did a clean and build and got the same
successful build.

So I am now totally dumb-struck. How can a project build with obvious
errors in it? But more importantly, does anyone have a working library to
load png images for the iPhone?
Thanks in advance.
Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’m getting the exact same linker problem (all six _kUTTypeXXX undefined errors), but there is no “MobileServices.framework” on my system.

There is a “MobileCoreServices.framework” which I added, but I still get the same six link errors. Very odd. Any ideas?

This is using the very latest SDL 1.3 from the Mercurial repository, and also SDL_Image 1.2.10 which I used to build libSDL.a using the iPhone XCode project that comes with that package.

I am using a modified XCode project from the “Demos” folder in “XCode-iOS” in the SDL 1.3 distribution.

Okay, I got if figured out. When dragging the MobileCoreServices.framework into the XCode project window, the “Copy items into destination’s group folder (if needed)” checkbox was checked, which would copy the framework into my project’s folder, resulting in a warning when I tried to build that the i386 target from the framework was missing. Odd. Oh well, resolved now.