SDL_gfx on Mac OS X

Hello,

I’m new to both SDL and Mac programming…
Does anybody have any experience compiling SDL_gfx for Mac OS X using Xcode?

I’m trying to create a SDL_gfx framework for another project. I get as far
as linking at which point I get the "internal link edit command failed"
error. No other information is given.

Thanks,

Ryan

In the hopes of somebody responding, I’ll post some more info. I’ve played
around with this some more and now I get the following link errors:

Undefined symbols:
_SDL_Delay
_SDL_GetTicks
_SDL_CreateRGBSurface
_SDL_FreeSurface
_SDL_LockSurface
_SDL_MapRGB
_SDL_MapRGBA
_SDL_SetAlpha
_SDL_UnlockSurface
_SDL_UpperBlit
_SDL_SetColorKey

In my Xcode project, I’ve simply taken all the .c/.h files and added them,
along with the reference to the SDL framework.
Please help! I can’t imagine what I could be doing wrong.

Thanks,

Ryan

“Michael Ryan Bannon” <ryan.bannon at humagade.com> wrote in message
news:e10h43$kqm$1 at sea.gmane.org…> Hello,

I’m new to both SDL and Mac programming…
Does anybody have any experience compiling SDL_gfx for Mac OS X using
Xcode?

I’m trying to create a SDL_gfx framework for another project. I get as
far as linking at which point I get the “internal link edit command
failed” error. No other information is given.

Thanks,

Ryan

Undefined symbols:
_SDL_Delay
_SDL_GetTicks
_SDL_CreateRGBSurface
_SDL_FreeSurface
_SDL_LockSurface
_SDL_MapRGB
_SDL_MapRGBA
_SDL_SetAlpha
_SDL_UnlockSurface
_SDL_UpperBlit
_SDL_SetColorKey

In my Xcode project, I’ve simply taken all the .c/.h files and
added them,
along with the reference to the SDL framework.
Please help! I can’t imagine what I could be doing wrong.

I’m guessing you added the SDL framework to the /project/, but not to
your /target/. If you look at the detailed build log for your target,
the link command should include ‘-framework SDL’ somewhere amongst
all the other stuff; if it doesn’t, this is definitely your problem.
You can just drag the framework in the appropriate section of your
target in the X-Code tree view, and it should be added in.

JamesOn 6 Apr 2006, at 15:28, Michael Ryan Bannon wrote:

Some people, when confronted with a problem, think ?I know, I?ll use
regular expressions.? Now they have two problems.

Thanks for the response.
Unfortunately, the framework is in the target. When it was added to the project it immediately wint into the “Link Binary With Libraries” step in the target. Here’s the linker call.

Ld /test/Projects/SDL_gfx/build/Development/SDL_gfx.framework/Versions/A/SDL_gfx normal i386

cd /Humagade/Projects/SDL_gfx

/usr/bin/gcc-4.0 -o /test/Projects/SDL_gfx/build/Development/SDL_gfx.framework/Versions/A/SDL_gfx -L/test/Projects/SDL_gfx/build/Development F/test/Projects/SDL_gfx/build/Development -F/Users/ttongue/Library/Frameworks -filelist /test/Projects/SDL_gfx/build/SDL_gfx.build/Development/SDL_gfx\ (Upgraded).build/Objects-normal/i386/SDL_gfx.LinkFileList 

-framework SDL -framework OpenGL -framework Cocoa -arch i386 -prebind -Wl,-single_module -compatibility_version 1 -current_version 1 -install_name @executable_path/../Frameworks/SDL_gfx.framework/Versions/A/SDL_gfx -dynamiclib

The line “-framework SDL” is the important one, I guess.

This is blowing my mind! The only other possibile solutions I can think of (although they didn’t work or I don’t know how to act on a possible solution) are:

  • needing other frameworks in the target (I tried this with a bunch of them…at one point, all frameworks from /System/Library/Frameworks…but with no success)

  • not linking to the proper framework (I downloaded SDL-1.2.9.dmg from www.libsdl.org, the runtime library…somebody had mentioned using the development library download, which is SDL-devel-1.2.9, but it only contained docs and project templates that haven’t offered much help)

  • some linker or compile setting is wrong

  • something to do with Obj-C (SDL requires some Obj-C stuff, SDLmain.m/h, but I’m not building an executable, so that shouldn’t matter…plus, that doesn’t resemble the problem)

Any ideas? If there is any other information I can provide, please don’t hesitate to ask!

Thanks,

Ryan

“James Turner” wrote in message news:8A18B67F-58DC-4602-8863-A4383110DE88 at mac.com…On 6 Apr 2006, at 15:28, Michael Ryan Bannon wrote:

Undefined symbols:

 _SDL_Delay

 _SDL_GetTicks

 _SDL_CreateRGBSurface

 _SDL_FreeSurface

 _SDL_LockSurface

 _SDL_MapRGB

_SDL_MapRGBA

_SDL_SetAlpha

_SDL_UnlockSurface

_SDL_UpperBlit

_SDL_SetColorKey




In my Xcode project, I've simply taken all the .c/.h files and added them, 

along with the reference to the SDL framework.

Please help!  I can't imagine what I could be doing wrong.

I’m guessing you added the SDL framework to the /project/, but not to your /target/. If you look at the detailed build log for your target, the link command should include ‘-framework SDL’ somewhere amongst all the other stuff; if it doesn’t, this is definitely your problem. You can just drag the framework in the appropriate section of your target in the X-Code tree view, and it should be added in.

James

Some people, when confronted with a problem, think ?I know, I?ll use regular expressions.? Now they have two problems.



SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Thanks for the response.
Unfortunately, the framework is in the target. When it was added to the
project it immediately wint into the “Link Binary With Libraries” step in
the target. Here’s the linker call.

  • needing other frameworks in the target (I tried this with a bunch of
    them…at one point, all frameworks from /System/Library/Frameworks…but
    with no success)

These look like SDL symbols to me. So this is probably not it.

  • not linking to the proper framework (I downloaded SDL-1.2.9.dmg from
    www.libsdl.org, the runtime library…somebody had mentioned using the
    development library download, which is SDL-devel-1.2.9, but it only
    contained docs and project templates that haven’t offered much help)

Seriously, the Xcode project templates were designed to be helpful
because they already have precoined/working SDL/Xcode projects setup
for you. Maybe you should try these and compare the differences to
yours.

http://www.libsdl.org/cvs/SDL-devel-extras.dmg

  • some linker or compile setting is wrong

If you are using the 10.4u Universal SDK, I have noticed that all the
library and framework search paths get rerouted to look in SDK
directories instead of the usual places. You might need to add
/Library/Frameworks (presuming you installed here) to the Framework
Search Paths in your project build settings. (Even if you’re not using
the 10.4u SDK, you might try this anyway as it can’t hurt.)

  • something to do with Obj-C (SDL requires some Obj-C stuff, SDLmain.m/h,
    but I’m not building an executable, so that shouldn’t matter…plus, that
    doesn’t resemble the problem)

Probably not in this case.

-Eric> From: “Michael Ryan Bannon” <ryan.bannon at humagade.com>

Subject: Re: [SDL] SDL_gfx on Mac OS X

Thanks for the response.

I looked at the extras…in particular, the simple SDL Applications. Here
are the differences I found:

  • the example builds successfully (obviously…haha)
  • the example includes SDL.h with different syntax (the example uses
    "#include “SDL.h”, while I use #include <SDL/SDL.h>, which is what I thought
    was the proper way to go…although I later found out that the project
    defines the SDL.framework/Headers directory in its include search path, so I
    guess that answers that)
  • the example defines $HOME/Library/Frameworks and /Library/Frameworks for
    the frameworks search path (I tried this also…didn’t help)
  • the example references the Cocoa, AppKit, and Foundation frameworks (but
    it had been determined in a previous post that this is not the problem)

What really confuses me is this: how could Xcode find the SDL header files
when compiling but not the framework binary when linking? Especially when
all I did was just add a reference to SDL.framework in the project…nothing
else.

Thanks again,

Ryan

“E. Wing” wrote in message
news:3c7e3c8a0604061223t48f76114sd7289808b3f7d90d at mail.gmail.com…>> From: “Michael Ryan Bannon” <ryan.bannon at humagade.com>

Subject: Re: [SDL] SDL_gfx on Mac OS X

Thanks for the response.
Unfortunately, the framework is in the target. When it was added to the
project it immediately wint into the “Link Binary With Libraries” step in
the target. Here’s the linker call.

  • needing other frameworks in the target (I tried this with a bunch of
    them…at one point, all frameworks from /System/Library/Frameworks…but
    with no success)

These look like SDL symbols to me. So this is probably not it.

  • not linking to the proper framework (I downloaded SDL-1.2.9.dmg from
    www.libsdl.org, the runtime library…somebody had mentioned using the
    development library download, which is SDL-devel-1.2.9, but it only
    contained docs and project templates that haven’t offered much help)

Seriously, the Xcode project templates were designed to be helpful
because they already have precoined/working SDL/Xcode projects setup
for you. Maybe you should try these and compare the differences to
yours.

http://www.libsdl.org/cvs/SDL-devel-extras.dmg

  • some linker or compile setting is wrong

If you are using the 10.4u Universal SDK, I have noticed that all the
library and framework search paths get rerouted to look in SDK
directories instead of the usual places. You might need to add
/Library/Frameworks (presuming you installed here) to the Framework
Search Paths in your project build settings. (Even if you’re not using
the 10.4u SDK, you might try this anyway as it can’t hurt.)

  • something to do with Obj-C (SDL requires some Obj-C stuff, SDLmain.m/h,
    but I’m not building an executable, so that shouldn’t matter…plus, that
    doesn’t resemble the problem)

Probably not in this case.

-Eric

I looked at the extras…in particular, the simple SDL Applications. Here
are the differences I found:

  • the example includes SDL.h with different syntax (the example uses
    "#include “SDL.h”, while I use #include <SDL/SDL.h>, which is what I thought
    was the proper way to go…although I later found out that the project
    defines the SDL.framework/Headers directory in its include search path, so I
    guess that answers that)

For the OS X framework, <SDL/SDL.h> would be the proper Apple
convention, but #include “SDL.h” is encouraged for portability reasons
as not all distributions/platforms put their headers in a place that
will map to <SDL/SDL.h>.

What really confuses me is this: how could Xcode find the SDL header files
when compiling but not the framework binary when linking? Especially when
all I did was just add a reference to SDL.framework in the project…nothing
else.

Attached is framework project I whipped together which you can check
your stuff against.

However it just occurs to me that you might be only building on i386.
If you are using a non-Universal framework, then it only has PPC code,
and obviously all the symbols will be missing since there is no x86
code. Our Universal framework can only be found in CVS at the moment
(announced on the list several times). You better make sure you’re
using that one (and it’s up-to-date with our last test snapshot).

http://www.libsdl.org/cvs/SDL.dmg

-Eric
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDLDependentFramework.zip
Type: application/zip
Size: 12562 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060406/101fe0c7/attachment.zip

Wicked!

Thanks for the response and the ZIP. Just go in…gonna try it right now.
I have high hopes! I’ll let you know what happened. As for the i386/PPC
issues, I’m going to look into this as well. Thanks.

“E. Wing” wrote in message
news:3c7e3c8a0604061453t13e6966fpc200b6190def6f7b at mail.gmail.com

I looked at the extras…in particular, the simple SDL Applications. Here
are the differences I found:

  • the example includes SDL.h with different syntax (the example uses
    "#include “SDL.h”, while I use #include <SDL/SDL.h>, which is what I
    thought
    was the proper way to go…although I later found out that the project
    defines the SDL.framework/Headers directory in its include search path, so
    I
    guess that answers that)

For the OS X framework, <SDL/SDL.h> would be the proper Apple
convention, but #include “SDL.h” is encouraged for portability reasons
as not all distributions/platforms put their headers in a place that
will map to <SDL/SDL.h>.

What really confuses me is this: how could Xcode find the SDL header files
when compiling but not the framework binary when linking? Especially when
all I did was just add a reference to SDL.framework in the
project…nothing
else.

Attached is framework project I whipped together which you can check
your stuff against.

However it just occurs to me that you might be only building on i386.
If you are using a non-Universal framework, then it only has PPC code,
and obviously all the symbols will be missing since there is no x86
code. Our Universal framework can only be found in CVS at the moment
(announced on the list several times). You better make sure you’re
using that one (and it’s up-to-date with our last test snapshot).

http://www.libsdl.org/cvs/SDL.dmg

-Eric--------------------------------------------------------------------------------


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Yup, it was the platform. Building on i386. Totally solved my problem!
Thanks!!!

“E. Wing” wrote in message
news:3c7e3c8a0604061453t13e6966fpc200b6190def6f7b at mail.gmail.com

I looked at the extras…in particular, the simple SDL Applications. Here
are the differences I found:

  • the example includes SDL.h with different syntax (the example uses
    "#include “SDL.h”, while I use #include <SDL/SDL.h>, which is what I
    thought
    was the proper way to go…although I later found out that the project
    defines the SDL.framework/Headers directory in its include search path, so
    I
    guess that answers that)

For the OS X framework, <SDL/SDL.h> would be the proper Apple
convention, but #include “SDL.h” is encouraged for portability reasons
as not all distributions/platforms put their headers in a place that
will map to <SDL/SDL.h>.

What really confuses me is this: how could Xcode find the SDL header files
when compiling but not the framework binary when linking? Especially when
all I did was just add a reference to SDL.framework in the
project…nothing
else.

Attached is framework project I whipped together which you can check
your stuff against.

However it just occurs to me that you might be only building on i386.
If you are using a non-Universal framework, then it only has PPC code,
and obviously all the symbols will be missing since there is no x86
code. Our Universal framework can only be found in CVS at the moment
(announced on the list several times). You better make sure you’re
using that one (and it’s up-to-date with our last test snapshot).

http://www.libsdl.org/cvs/SDL.dmg

-Eric--------------------------------------------------------------------------------


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl