Linker errors while Building SDL-1.3 for iPhone using XCode

Hi,

first of all, I’d ask you to please bear with me, because I am a newby
Mac-User. So I am probably
explaining things that are obvious to you pretty
verbose. That being said: My problem is that I can
compile and build the SDL-1.3 libraries and templates
for SDL for the iPhone, but I cannot use said
template, because the linker finds “undefined symbols”.
Namely it claims:

“_SDL_DrawLine” referenced from _SW_RenderLine in
libSDLSimulator.a (SDL_renderer_sw.o),
_SDL_DUMMY_RenderLine in libSDLSimulator.a (SDL_nullrender.o)"

“_SDL_BlendLine” referenced from

“_SDL_FillRect” referenced from _SW_RenderFill in
libSDLSimulator.a(SDL_renderer_sw.o),
_SDL_UnRLESurface in libSDLSimulator.a(SDL_RLEaccel.o),
_SDL_DUMMY_RenderFill in
libSDLSimulator.a(SDL_nullrender.o)

“_SDL_BlendRect” referenced from <same as above,
but without SDL_UnRLESurface>

symbol(s) not found.

Can you already see what I did wrong from these messages? :slight_smile:

If not, here’s what I did:

  • I checked out the current SDL 1.3 trunk into a directory (named SDL-1.3).
  • I started xCode on SDLiPhoneOS.xcodeproj
  • I built all three SDL libraries (libSDLiPhoneOS.a,
    libSDLSimulator.a) and the template, but the
    template build failed. It looked for the two previously
    generated .a files in a wrong directory. So I
    created the directory and copied the files to the new
    directory, built again, it worked.
  • I copied the generated template into the suggested directory
    ("/Developer/Platforms/iPhoneOS.platform/Developer/
    Library/xCode/Project Templates/SDL") and
    created a new Project using this template.

But I couldn’t compile and run the newly created
project, due to the linker errors listed above…

Any help is greatly appreciated! Sorry if I made a
noob-mistake, but I googled and couldn’t find any
resolution.

Thanks!
Philipp

Hello,

I’m leaving for holiday vacation at the moment, but here is my guess if
anyone wants to check further into this:

When programming the iPhone port, I don’t remember seeing an
SDL_DrawLine function … I’m thinking perhaps this was added in a new
file since then, and the iPhone XCode project is not compiling it when
building the library.

Anybody want to check up on this?

thanks,

  • Holmes

Philipp Bouillon wrote:> Hi,

first of all, I’d ask you to please bear with me, because I am a newby
Mac-User. So I am probably
explaining things that are obvious to you pretty
verbose. That being said: My problem is that I can
compile and build the SDL-1.3 libraries and templates
for SDL for the iPhone, but I cannot use said
template, because the linker finds “undefined symbols”.
Namely it claims:

“_SDL_DrawLine” referenced from _SW_RenderLine in
libSDLSimulator.a (SDL_renderer_sw.o),
_SDL_DUMMY_RenderLine in libSDLSimulator.a (SDL_nullrender.o)"

“_SDL_BlendLine” referenced from

“_SDL_FillRect” referenced from _SW_RenderFill in
libSDLSimulator.a(SDL_renderer_sw.o),
_SDL_UnRLESurface in libSDLSimulator.a(SDL_RLEaccel.o),
_SDL_DUMMY_RenderFill in
libSDLSimulator.a(SDL_nullrender.o)

“_SDL_BlendRect” referenced from <same as above,
but without SDL_UnRLESurface>

symbol(s) not found.

Can you already see what I did wrong from these messages? :slight_smile:

If not, here’s what I did:

  • I checked out the current SDL 1.3 trunk into a directory (named SDL-1.3).
  • I started xCode on SDLiPhoneOS.xcodeproj
  • I built all three SDL libraries (libSDLiPhoneOS.a,
    libSDLSimulator.a) and the template, but the
    template build failed. It looked for the two previously
    generated .a files in a wrong directory. So I
    created the directory and copied the files to the new
    directory, built again, it worked.
  • I copied the generated template into the suggested directory
    ("/Developer/Platforms/iPhoneOS.platform/Developer/
    Library/xCode/Project Templates/SDL") and
    created a new Project using this template.

But I couldn’t compile and run the newly created
project, due to the linker errors listed above…

Any help is greatly appreciated! Sorry if I made a
noob-mistake, but I googled and couldn’t find any
resolution.

Thanks!
Philipp


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

Hello,

I’m leaving for holiday vacation at the moment, but here is my guess if
anyone wants to check further into this:

When programming the iPhone port, I don’t remember seeing an
SDL_DrawLine function … I’m thinking perhaps this was added in a new
file since then, and the iPhone XCode project is not compiling it when
building the library.

Anybody want to check up on this?

thanks,

  • Holmes

Hi,

I will take a look at it, but I am pretty sure it is beyond my capabilities…
So, if any of you
SDL/Cocoa/Mac experts can do it, it would be solved faster ;).

Thanks,
Philipp

When programming the iPhone port, I don’t remember seeing an SDL_DrawLine
function … I’m thinking perhaps this was added in a new file since then,
and the iPhone XCode project is not compiling it when building the library.

It’s relatively new, AFAIK

Author: slouken
New Revision: 4242

Log:
Added stubs for software implementations of blending fills and line drawing

Modified: trunk/SDL/include/SDL_surface.hOn Sat, Dec 20, 2008 at 1:59 PM, Holmes Futrell wrote:
Date: 2008-12-20 05:14:28 -0800 (Sat, 20 Dec 2008)

— trunk/SDL/include/SDL_surface.h 2008-12-20 12:32:53 UTC (rev 4241)
+++ trunk/SDL/include/SDL_surface.h 2008-12-20 13:14:28 UTC (rev 4242)
@@ -366,6 +366,23 @@
(SDL_Surface * src, SDL_PixelFormat * fmt, Uint32 flags);

/*

    • This function draws a line with ‘color’
    • The color should be a pixel of the format used by the surface, and
    • can be generated by the SDL_MapRGB() function.
    • This function returns 0 on success, or -1 on error.
  • */
    +extern DECLSPEC int SDLCALL SDL_DrawLine
  • (SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color);


http://codebad.com/