oooh, shiny. i must say; i do appreciate bash scripts a lot. now where can i use this seeing i dont have mac? hmm. tough one
oooh, shiny. i must say; i do appreciate bash scripts a lot. now where can i use this seeing i dont have mac? hmm. tough one
I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.
@Stoney, thank you! This looks like a great solution, I'll try this now and report back soon.
Edit:
I added the IFDEFs at the beginning of my main file. Here the results:
1. When I use the single compiler call you gave me above, with the JEDI SDL headers (not the ones included in FPC), the game compiles and links, but crashes as soon as it tries to call SDL_INIT.
2. When I use your build script, it tells me:
So nothing has changed.Code:Linking fprl ld: warning: in ./libSDLmain.a, file was built for unsupported file format which is not the architecture being linked (i386) Undefined symbols: "_main", referenced from: __start in crt1.o (maybe you meant: _SDL_main)
The libSDLmain file was created by me some days ago using the "devel-lite" folder in the SDL for Mac download, and using the following compiler call (as stated in the FreePascal wiki):
But somehow the resulting library seems not to be correct.Code:gcc -c -o SDLMain.o SDLMain.m -I /Library/Frameworks/SDL.framework/Headers ar r libSDLMain.a SDLMain.o ranlib libSDLMain.a
Last edited by Mario Donick; 09-01-2011 at 09:30 AM.
The problem seems to be that the libSDLmain.a you made is 64 bit, which is done by default if you have Snow Leopard installed. You need to explicitly compile the library for i386 and PowerPC if you plan to make Universal Binaries.
You can have my libSDLmain.a (it has i386, x64_64 and ppc all in one file): Download here
Edit: If you use my build script you might want to change CFBundleIdentifier and CFBundleSignature for your application.
Last edited by Stoney; 09-01-2011 at 09:52 AM.
Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)
Programmer: A device for converting coffein into software.
Yes!! Stoney, this did the trick! :-D
Awesome I guess we really need a tutorial for new Mac OS X users.
Btw: If you would want or need to compile libSDLmain.a for yourself for i386 and ppc platforms you need to call this line
with an additional --arch i386 or --arch ppc parameter depending on which platform you need.gcc -c -o SDLMain.o SDLMain.m -I /Library/Frameworks/SDL.framework/Headers
Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)
Programmer: A device for converting coffein into software.
Sweet - so I guess this is solved now! Hooray!
Quick note to apple: Windows users have functionality disabled in their versions of windows (unless you have ultimate). In your case, you either include functionality or you dont. For the next Mac OS X version - please include the functionality 'Common Sense' and 'Helpfulness'. I've never seen such a long thread for a simple linking issue. Apple: Pioneering in unexpected ways.
I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.
I guess if there was a tutorial for beginners on how to start with SDL and FreePascal on a Mac, most of this would be more clearer. Also FreePascal Mac support is quite new in regard to how long FPC for Windows and Linux have been around.
It was worse when I started with Mac development about 2 1/2 years ago, there was even less information back then.
Last edited by Stoney; 09-01-2011 at 01:21 PM.
Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)
Programmer: A device for converting coffein into software.
Bookmarks