iDevGames Forums
Compiling SDL 1.2.8 with CW8 on 10.2 problems - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Compiling SDL 1.2.8 with CW8 on 10.2 problems (/thread-6000.html)



Compiling SDL 1.2.8 with CW8 on 10.2 problems - Zekaric - Jan 2, 2005 10:37 PM

I'm still a mac developer noobie but I've finally got to a point with my game that it would be a good idea to try to port what I have over to the Mac (from Windows).

Currently working with:
SDL 1.2.8
OS 10.2
Code Warrior v8

Anyone have a similar config? I'm using the code warrior projects that were included with the source snapshot. Code Warrior seemed to have converted the projects ok. One application path was no longer in existance and I changed if from {Compiler}Carbon Support to {Compiler}MacOS Support and that fixed one of the problems.

Attempting to build SDLmain Carbon I get a total of 100 errors in the build.
Attempting to build SDL Carbon results in 800.

A few examples of the errors I'm getting. I'm hoping it's just a simple change in the project as I suspect it's a project setting or something that's killing me.

Error : ')' expected
(included from:
CoreServices.h:75
Carbon.h:21
SDL_macevents.c:31)
MacMemory.h line 91 typedef CALLBACK_API_REGISTER68K( void , UserFnProcPtr, (void * parameter) );

Error : ')' expected
(included from:
Files.h:29
Components.h:33
CoreServices.h:91
Carbon.h:21
SDL_macevents.c:31)
OSUtils.h line 167 NewDeferredTaskUPP(DeferredTaskProcPtr userRoutine);

Error : illegal function definition
(included from:
Files.h:29
Components.h:33
CoreServices.h:91
Carbon.h:21
SDL_macevents.c:31)
OSUtils.h line 186 DisposeDeferredTaskUPP(DeferredTaskUPP userUPP);

Error : identifier expected
(included from:
Files.h:29
Components.h:33
CoreServices.h:91
Carbon.h:21
SDL_macevents.c:31)
OSUtils.h line 231 };

etc...


Compiling SDL 1.2.8 with CW8 on 10.2 problems - NCarter - Jan 3, 2005 05:06 AM

If I were you, I'd avoid trying to compile the SDL source code myself and just stick to using the prebuilt SDL.framework. That works fine for me with a Mach-O project in CodeWarrior 8. The only reasons I can think of for building your own are a) if you're trying to make a static library version of SDL or b) if you're trying to support Mac OS 9, but there's no compelling reason to do either of those in my opinion.

I don't know about CW's problem with SDL specifically, but I've found with many open source projects that while the supplied Xcode project is fine, the CW project is somewhat out of date and therefore doesn't work properly. Also, the source code often gets modified in ways which aren't directly compatible with CW's headers, and unless there's someone on the team who actively works on the CW project, it all goes out of sync very quickly.

Expect to have to do quite a lot of work if you want to fix these compilation errors yourself. If you want help to make this work, I might be able to offer some more clues given a bit more information about your current settings, but I strongly recommend you try to use SDL.framework first!


Compiling SDL 1.2.8 with CW8 on 10.2 problems - Zekaric - Jan 3, 2005 10:45 AM

I was mainly worried that the prebuilts wouldn't work with CW8. Foolish me for not even trying. I did need to build a debug version of SDL on Windows and it went somewhat painlessly and was hoping to have the same ability on the Mac if needed. No biggy. I'll try the prebuilts and see how that goes.

Thanks!


Compiling SDL 1.2.8 with CW8 on 10.2 problems - NCarter - Jan 3, 2005 10:55 AM

In my experience, static libraries tend to need to be built with CodeWarrior if you want them to link to CW projects properly. I tried using the Xcode build of ODE with CW and, although I managed to force it to link, all sorts of bad things happened when the resulting program was run! Of course, it's possible I was doing something wrong....

On the other hand, frameworks aren't a problem at all. Smile

[EDIT: actually, frameworks could be a problem if they have an underscore in their name. If you want to use SDL_image or SDL_mixer in your project, let me know. I've already jumped through those hoops in my own projects!]


Compiling SDL 1.2.8 with CW8 on 10.2 problems - Zekaric - Jan 3, 2005 02:09 PM

You know, I've not had a fun compiling experience on the mac yet. Even an example project with project builder was giving me grief.

Yup, I'm using SDL_mixer. Living dangerously here. But that's about it.

BTW, what's ODE?


Compiling SDL 1.2.8 with CW8 on 10.2 problems - NCarter - Jan 3, 2005 02:34 PM

Zekaric Wrote:You know, I've not had a fun compiling experience on the mac yet. Even an example project with project builder was giving me grief.
I've got used to the idea that no-one else's source ever compiles first time. That'll also often be the case if you try to use Project Builder instead of Xcode. That's just the way it is, unfortunately; if you're not using the same standard as everyone else, you have to figure out everything for yourself. Sad

Quote:Yup, I'm using SDL_mixer. Living dangerously here. But that's about it.
OK, the situation is that versions of CodeWarrior prior to some version after 9.0 have a problem with frameworks with underscores in the name. It fails to link with an internal error, if I recall correctly.

The solution's simple enough: get the source code to the library, open the Xcode / Project Builder project and build your own version with the name changed to not have an underscore in it. This will give you a framework with a name like 'SDLmixer.framework' which can happily live alongside the real one in your Library/Frameworks folder, and can be safely included in your application bundle's Frameworks folder too.

If you want to see this in action, check out my game Rescue. The playable archive contains my custom versions of SDL_image and SDL_mixer inside the application bundle (you could pull them out and use them for yourself if you want).

Quote:BTW, what's ODE?
ODE is an open source rigid body physics library. I'm looking at incorporating into the aforementioned Rescue.