About the undefined _main problem, from the FAQ:
You *must* include SDLMain.m/.h in your application,
because this is the code that defines SDL's entry point.
If you fail to do this, it is likely that "_main undefined"
will be thrown by the linker.
You need to add -lSDLmain to the link line, which includes the compiled
version of SDLMain.m.
I am putting together a new pkg installer for SDL-devel on OSX, for
Xcode. This new installer includes updated versions of the “SDL
Application” and “SDL OpenGL Application” project templates, an updated
SDL target template, and installs these templates in the correct
location for Xcode.
OK, but realize that I’ve already done this work last weekend The
new projects should be included with SDL 1.2.7. The exact same project
files work for both XCode and Project Builder 2.x. The only downside is
that the Xcode bells and whistles don’t activate (zero-link,
fix-and-continue, perhaps others) until the target is converted to a
native target, which Xcode handily performs for you (minus the
framework annoyance you have mentioned).
I realize another individual has handled packaging files for OSX in the
past but Xcode has been out for a while now without any update to the
SDL installer. I hope I don’t hurt anyone’s feelings, but users are
starting to have trouble with the templates that don’t work anymore.
The new SDL installer will put the stationary/templates in the right
directories.
That said, I need to ask a question of those familiar with SDL on OSX:
Can we move the framework installation path from the user’s to the
global library?
Xcode features ZeroLink, a system to increase compile speeds in
development builds by delaying linking until execution. However,
running an SDL application with ZeroLink enabled fails unless you add
SDL.framework to the project. However, Xcode references frameworks by
their path ("/users/phip/library/frameworks/SDL.framework"). A template
with such a reference would only work for that user. If we moved the
framework to the global /library/frameworks, this would work fine.
Is there a reason installing SDL into /Library/Frameworks would be a
bad idea?
The current “runtime” installers place the library in
/Library/Frameworks, and the “devel” installers put frameworks in
~/Library/Frameworks. There may not be much of an advantage to this
anymore, but there will be a few issues migrating to a condition where
all files are installed in /Library/Frameworks.
The big problem is to convert all of the projects (including the
projects we use to compile SDL and the installer packages). This also
includes other projects like SDL_image, SDL_mixer, SDL_sound, SMPEG,
and others that already rely on the framework to be where it is now,
and all put themselves into ~/Library/Frameworks/
OR I suppose it could be installed in both places to avoid breakage in
all existing project files (everyone using Xcode/Project Builder and
the framework up to this point will be affected).
I do, however, want to keep the projects working back to Mac OS X 10.1
(yes people still use it and we’ve actually done some work to make sure
10.1 is still supported). If the Xcode projects will break
backword-compatibility, then we’ll have to distribute both sets of
projects & templates with the installer and install the correct set
with the installer script (not a big deal really).
Regards,
DarrellOn Feb 4, 2004, at 4:50 PM, sdl-request at libsdl.org wrote: