Results 1 to 10 of 37

Thread: Linking Issues on MacOS X 10.6.5

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    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.

  2. #2
    @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:

    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)
    So nothing has changed.

    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):

    Code:
    gcc -c -o SDLMain.o SDLMain.m -I /Library/Frameworks/SDL.framework/Headers
    ar r libSDLMain.a SDLMain.o
    ranlib libSDLMain.a
    But somehow the resulting library seems not to be correct.
    Last edited by Mario Donick; 09-01-2011 at 09:30 AM.

  3. #3
    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.

  4. #4

  5. #5
    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
    gcc -c -o SDLMain.o SDLMain.m -I /Library/Frameworks/SDL.framework/Headers
    with an additional --arch i386 or --arch ppc parameter depending on which platform you need.
    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.

  6. #6
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    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.

  7. #7
    Quote Originally Posted by code_glitch View Post
    I've never seen such a long thread for a simple linking issue.
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •