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
    ... because I accidently removed all the contents of my /usr/local folder, I had to reinstall fpc, lazarus and SDL. Because the framework version did not work anymore when I tried to use the compiler call above (it did not find the SDL library although libSDLmain.a was again in /usr/local/lib), I removed the SDL framework and instead installed the source version of SDL. ./configure, make, make install worked without problems and now all SDL libs are in /usr/local/lib again. Only for SDL image, I still use the framework version.

    I changed the compiler call to

    fpc -Mobjfpc -ve -k-lSDL -k-lSDLmain -k-framework -kSDL_image -k-framework -kCocoa -Fl/usr/X11/lib fprl.pp


    This gives me the following output:

    Linking fprl
    ld: warning: in /usr/local/lib//libSDL.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
    ld: warning: in /usr/local/lib//libSDLmain.a, file was built for unsupported file format which is not the architecture being linked (i386)
    ld: warning: in /usr/local/lib//libSDL-1.2.0.dylib, 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)
    "_SDL_SaveBMP_RW", referenced from:
    _SDL_SDL_SAVEBMP$PSDL_SURFACE$PCHAR$$LONGINT in sdl.o
    "_SDL_SetVideoMode", referenced from:
    _P$FPRL_SETOPTIONS in fprl.o

    and so on.

    Esp. the first three lines are disturbing me.

    What can I do now? I was so happy that everything worked, but obviously I did not understand how I got SDL to work on my system, so I can't explain the process to end users of the game as well.

    Please please help ... (I read all the topics related to SDL on MacOS in this forum, I also read the section on freepascal.org).


    Edit: Just in case it is a problem with PowerPC vs. i386, I tried to use the option to build a universal binary, as stated in the MacOS X readme in the SDL source folder. There it says I could call a script named fatbuild.sh. Well, I tried, but this script seems to have errors, or not to work anymore on Leopard.
    Last edited by Mario Donick; 06-01-2011 at 12:31 PM.

  2. #2

    Unhappy Reboot (of my SDL issues)

    Again -- I removed FPC, Lazarus, everything SDL related. What I then did was to set up everything, so the following conditions are given:

    1. MacOS "Snow Leopard" 10.6.5
    2. All developer Tools installed

    3. FPC 2.4.2, installed in /usr/local/*
    4. SDL.Framework 1.2.14, installed in /Library/Frameworks
    5. SDL_Image.Framework, installed in /Library/Frameworks

    6. Compiled libSDLMain.a, based on SDL devel-lite 1.2.14, installed in /usr/local/lib and in the source dir of my program

    7. Using the SDL units provided by FPC 2.4.2

    8. Compiler call: fpc -Mobjfpc -ve -k-framework -kSDL -k-framework -kSDL_image -k-framework -kCocoa -Fl/usr/X11/lib -Fl/usr/local/lib fprl.pp

    (it does, by the way, makes no difference if I explicitly refer to libSDLMain.a by adding -lSDLMain to the compiler options.)

    So, why do I still get the "library not found for -lSDL-1.2.0" message? I simply don't understand what's going wrong here ...

  3. #3
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Sorry that this may seem like a one-way conversation for you so far. I myself am a new Mac user and I love FPC and have been using Lazarus and SDL for my development for some time so I find this topic very interesting actually. However I unfortunately cannot offer you too many solutions as I find myself stuck with the current version of Lazarus' use of the debugger crashing on my system.

    I am however aware of the problem surrounding the current JEDI-SDL version with Lazarus on Mac OS X. Fortunately I just so happen to have direct access of the maintainer of the library and he has given me an unofficial copy of it, updated to work properly for the Mac. If you are interested, I can email you a copy of it to test out, just PM me and we'll talk.

    I'm glad that there are more people trying to develop with Object Pascal on the Mac and posting about it. I myself am finding resources on the platform a bit sparse at the moment so the more people posting about this the better. Thanks for doing your part!
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #4
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Mac os is a little like linux isnt it? Maybe my post here may be of some use to you: http://www.pascalgamedevelopment.com...ghlight=ubuntu

    i'm not sure if this helped beyond a hint, but stil...
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  5. #5
    Thanks for the supporting posts. At least I know now that I'm not spamming

    Perhaps, if we figured out how to set up a working SDL + FPC environment on MacOS in a way which works on all recent Macs, we could write an article about it.

    Additionally, it may be important to summarize how to distribute a developed game to the end users -- because I fear that simply installing SDL Frameworks on the end user machine may not be enough (here I would need information, too, but later, when I again successfully linked my game...)

    @code_glitch: Well, I wish it was as easy as with Linux. On Mac, first of all you have to decide if you want to use the standard Unix/Linux way of having the SDL libraries in a standard directory like /usr/local/lib, OR if you want to have the Mac way of having the SDL libraries as a Framework in /Library/Frameworks . Getting everything to work on Linux was very easy, I simply installed SDL, SDL_image and the related development packages, and simply could call fpc fprl.pp, without any special parameters. On Mac OS, as shown in the previous posts, its all a mess, and nothing works currently, regardless if I use the Unix/Linux way or the Mac way.

    @WILL: PM.

  6. #6
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  7. #7
    Thanks, JSoftware, but I know this page. The setup described above was done after reading that page ...

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
  •