Getting started on OS X

At various times in the past, I’ve installed SDL and gotten the “Aliens” demo running on OS X. Haven’t done this for some time, and am now on Snow Leopard, ready to begin porting a game of mine (www.actionsoft.com/games/midnightmansion/) over to SDL, with the intent of getting a Universal Binary (finally), along with iPhone and Windows ports.

A few questions:

  1. I installed SDL 1.2.14 as well as the current Audio and Image add-ons. And I used the standard XCode template for a Carbon SDL app, and it ran just fine, creating a nice blank window. But I wanted to get the “Aliens” demo that I’ve run before up and running, so I copied over aliens.c and the data folder into my XCode project, and commented out the main() function that comes with the standard template file. Ran it, and it faded out the screen to black, but then quit abruptly. I then tried some other targets, and now it’s giving me a "GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file SDLMain.m) I can’t even get it back to running and then quitting after a black window. It now gives me this error all the time.

I don’t claim to be the best programmer – link-time errors always tend to baffle me. Could use some help here. OR, is some demo other than Aliens recommended? I just want to get something with basic sound and animation up and running, and I can then take it from there.

  1. Should I use SDL 1.2.14, or the in-progress SDL 1.3? Like I mentioned, this is for MacOS X, Windows, and iPhone development. (Porting an older Carbon Mac app over to this.)

  2. Just out of curiosity: is Sam no longer working for Blizzard, but now managing SDL full-time? If so, that would be pretty sweet news, and added motivation to port my games to SDL, knowing it’s being actively supported. I don’t mind a $500 fee too much, if it comes with active support! I just finished doing a game with the Garage Games engine, and was quite frustrated with the total lack of support / bug fixes there, and don’t intend to go back.

-Vern

Okay, so I recreated the project from scratch to get rid of the “GCC 4.2” error, but I’d still like to know what caused this, since it feels like the slightest change to project build targets will likely create this again.

As for the program launching and doing just a black window then quitting, that was because the “data” folder wasn’t in the same directory as the application. Fixed, and now it runs nicely.

Only thing is there are no masks. There is a white box around the player ship and aliens. Is that normal for this demo??

VernJensen wrote, On 10/12/09 12:38 PM:

GCC 4.2 is not compatible with the Mac OS X 10.4 SDK

I’ve only been building SDL apps using command line tools (makefile) but
the error message you saw matches my experience. It means pretty much
what it says: As far as I know if you are building under Snow Leopard
and you want the binaries you produce to be able to run on Mac OS 10.4
and 10.5 machines too, you have to 1) build using the 10.4 SDK, and 2)
use gcc 4.0 as your compiler instead of using gcc 4.2. The newer version
of the compiler is not compatible with that old a verson of the SDK.

  1. I installed SDL 1.2.14 as well as the current Audio and Image add-ons. And I used the standard XCode template for a Carbon SDL app, and it ran just fine, creating a nice blank window. But I wanted to get the “Aliens” demo that I’ve run before up and running, so I copied over aliens.c and the data folder into my XCode project, and commented out the main() function that comes with the standard template file. Ran it, and it faded out the screen to black, but then quit abruptly. I then tried some other targets, and now it’s giving me a "GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file SDLMain.m) I can’t even get it back to running and then quitting after a black window. It now gives me this error all the time.

i prefer using the terminal and a simple text editor for development.
perhaps try a simple makefile ?

I don’t claim to be the best programmer – link-time errors always tend to baffle me. Could use some help here. OR, is some demo other than Aliens recommended? I just want to get something with basic sound and animation up and running, and I can then take it from there.

if you post a link to the source tar ball i an attempt it here.

  1. Should I use SDL 1.2.14, or the in-progress SDL 1.3? Like I mentioned, this is for MacOS X, Windows, and iPhone development. (Porting an older Carbon Mac app over to this.)

sdl-1.2 is still stable and what is widely used. sdl-1.3 is still beta.
i would suggest being familiar with both.

mattmatteh at mac.com wrote, On 13/12/09 10:19 AM:

targets, and now it’s giving me a "GCC 4.2 is not compatible with
the Mac OS X 10.4 SDK (file SDLMain.m)

This part of the problem is simple: You have to specify gcc 4.0 if you
are going to build with the older 10.4 SDK, which you have to do if you
want the result to be able to run under Mac OS 10.4.

i prefer using the terminal and a simple text editor for development.
perhaps try a simple makefile ?
[…]
sdl-1.2 is still stable and what is widely used.

Maybe you can help with this: I’ve been unsuccessful at getting a static
build of an application that uses sdl, sdl_image, sdl_ttf, and
sdl_mixer. I could go through all the things that don’t work, but if you
know of a makefile that demonstrates building a simple test app that
way, that would answer all the questions.

Thanks

Sidney